?? ex503.m
字號:
%*******************************************************
%程序:EX503.M
%功能:利用擦除方式顯示動畫
%*******************************************************
speed=1000;
x=linspace(0,2*pi,speed); %設置x范圍及性質
y=tan(sin(x))-sin(tan(x)); %設置x、y的關系
plot(x,y); %繪制曲線
n=length(x) %以x設置變量,形成動態效果
line_handle=line('LineStyle','o','MarkerSize',25,'EraseMode','xor', 'MarkerEdgeColor','b','MarkerFaceColor','r'); %設置線條屬性
i=1;
while 1
set(line_handle, 'xdata',x(i),'ydata',y(i));
drawnow
i=i+1; %設置循環條件
if i>n
i=1;
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -