matlab绘制旋转地球体怎么做?function [res] = test6(r)%创建旋转的球体[x,y,z]=sphere(r);h=surfl(x,y,z);shading interpcolormap(winter)axis equalwhile 1rotate(h,[1 1 0],2);drawnowend为什么总是有错误?哪里错了?

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 15:19:06
matlab绘制旋转地球体怎么做?function [res] = test6(r)%创建旋转的球体[x,y,z]=sphere(r);h=surfl(x,y,z);shading interpcolormap(winter)axis equalwhile 1rotate(h,[1 1 0],2);drawnowend为什么总是有错误?哪里错了?

matlab绘制旋转地球体怎么做?function [res] = test6(r)%创建旋转的球体[x,y,z]=sphere(r);h=surfl(x,y,z);shading interpcolormap(winter)axis equalwhile 1rotate(h,[1 1 0],2);drawnowend为什么总是有错误?哪里错了?
matlab绘制旋转地球体怎么做?
function [res] = test6(r)
%创建旋转的球体
[x,y,z]=sphere(r);
h=surfl(x,y,z);
shading interp
colormap(winter)
axis equal
while 1
rotate(h,[1 1 0],2);
drawnow
end
为什么总是有错误?哪里错了?

matlab绘制旋转地球体怎么做?function [res] = test6(r)%创建旋转的球体[x,y,z]=sphere(r);h=surfl(x,y,z);shading interpcolormap(winter)axis equalwhile 1rotate(h,[1 1 0],2);drawnowend为什么总是有错误?哪里错了?
你让他无限循环,你关闭图形窗口,那个时候h的句柄就被关闭了,所以就报错误了;
你然他转一定圈数停止!
比如转一百圈
function [res] = test6(r)%创建旋转的球体
t=1;
[x,y,z]=sphere(r);
h=surfl(x,y,z);
shading interp
colormap(winter)
axis equal
while t