简体   繁体   English

如何在MATLAB中绘制3D角度

[英]how to draw a 3D angle in MATLAB

I have three angles who's values are 0.0 , 94.3750 , -0.5625. 我有三个角度,分别是0.0,94.3750和-0.5625。 Starting from those 3 angles, how can I draw an 3D angle in MATLAB? 从这三个角度开始,如何在MATLAB中绘制3D角度? Thanks in advance 提前致谢

You can try something like this: 您可以尝试如下操作:

angles=abs(pi/2*rand(3,50)); %data
figure
for ii=1:size(angles,2)
quiver3(0,0,0,cos(angles(1,ii)),cos(angles(2,ii)),cos(angles(3,ii))) %plot arrow
view(30,30) %or Matlab will choose it arbitrarily
axis([0 1 0 1 0 1]) %just for convenience
pause(.2)
end

and if you want to save the figures in order: 如果要按顺序保存数字:

angles=abs(pi/2*rand(3,50));
figure(1)
for ii=1:size(angles,2)
quiver3(0,0,0,cos(angles(1,ii)),cos(angles(2,ii)),cos(angles(3,ii)))
view(30,30)
axis([0 1 0 1 0 1])
pause(.2)
file_name= sprintf('%0.4d_%s_%s',ll);
print('-f1',file_name,'-dpng')
close(1)
end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM