a = [1 2 3;4 5 6;7 8 9]; b = [-1 -2 -3; -4 -5 -6;-7 -8 -9]; c = [10 20 30; 40 50 60; 70 80 90]; Hist(:,:,1) = a; Hist(:,:,2) = b; Hist(:,:,3) = c; Hist_1 = circshift(Hist,[0,0,-1]); Hist_2 = circshift(Hist,[1,0,0]); Hist_3 = circshift(Hist,[0,1,0]);
Hist:
Hist_1:
Hist_2:
Hist_3: