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/07/12 20:04:47
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为什么总是有错误?哪里错了?
xN@_] %4]A,2Ԗmve P*@brD8U(If8^ c Vtv~Qۚͅ/wxOV9OuT;%%PI@(6kEZ9 s*dHF2hݤaEd'NeQRUM7&E'4Vǒ))T5*6l8b+?y{3oL}{h([!;GR +&ݧc٥RcRCP)2qG#}%Ͼ` w5va }U;.5q'ysF'l܆&NA״sų*tY*ލ w\XqpՄva/;pD^Vҙ7MM962wt ]x!

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