- 积分
- 1
- 注册时间
- 2005-7-16
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2005-7-27 15:54:34
|
显示全部楼层
来自 江苏南京
Re:【原创】MATLAB开发的最新效果
写一段窗口菜单隐藏的代码
format compact
set(gcf,'Menubar','none','Name','3D Line Plot - Path and Velocity', ...
'NumberTitle','off','Position',[10,350,400,300]);
t = 0:0.1:3;
x = 2*sin(2*t);
y = 3*cos(2*t);
z = t;
h1 = plot3(x,y,z, ...
'LineWidth',2, ...
'Color','k');
% animation -----
axis([-3 3 -5 6 0 4]);
hold on
for i=1:length(t)
if i> 1
delete(h2); % deletes the marker
delete(h3); % delete the line
end
% creats a filled patch of yellow color
h2 = plot3(x(i),y(i),z(i),'bo','MarkerFaceColor','r'); % creates a marker
h3 = line([x(i) x(i)],[y(i) y(i)],[0 z(i)],'Color','r');
pause(0.1) % pauses the plot or you can't see the animation
end
delete(h3);
%-------------------------------------
% title in bold face italic in black color
title('\bf\it3D Line Plot and Velocity Vector','Color','k', ...
'VerticalAlignment','bottom')
ylabel('y', ...
'FontWeight','b','Color','b', ...
'VerticalAlignment','bottom'); % boldface blue
xlabel('x', ...
'FontWeight','b','Color','b', ...
'VerticalAlignment','bottom'); % boldface blue
zlabel('z', ...
'FontWeight','b','Color','b', ...
'VerticalAlignment','bottom'); % boldface blue
quiver3(x,y,z,4*cos(4*t),-6*sin(t),1,2,'b')
hold off
textstr(1)={'x = 2Sin(t)'};
textstr(2)={'y = 3Cos(t)'};
textstr(3)={'z = t'};
text(1.5,4,2,textstr,'FontWeight','b')
grid |
评分
-
1
查看全部评分
-
|