% slice
%% coordinate grid
x=[1:10]; y=x; z=x;
[X Y Z]=meshgrid(x,y,z);

%%
for N=1:10;
   V(:,:,N)=repmat(N,10,10);
end

figure(1); clf
Sx=5; Sy=[5]; Sz=[3 8];
slice(X,Y,Z,V,Sx,Sy,Sz)
B=-70;
for N=1:20;
   B=B+4; set(gca,'Cameraposition',[-40 B 30])
end