1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| function [] = plan(up)
t = -40:40;
s = -40:40;
[t,s]=meshgrid(t,s);
m = moviein(up+1);% animation
for i=0:1:up
hold on
x = t;
z = s;
y = i + 0.*t + 0.*s; %le plan qui varie
view(45, 10);
if i==0
S_handle = surf(x,y,z,'EdgeColor','none','FaceColor','b')
else
set(S_handle,'YDATA',y)
end
Surface(27,9); %ma surface en question
alpha(.6)
xlabel('x');ylabel('y');zlabel('z');
set(gca,'XLim',[-40 40],'YLim',[-40 40],'ZLim',[-40 40]);
pause(0.5)
hold off
m(:,i+1)=getframe;
end |