matlab绘制旋转地球体怎么做?
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/08/05 06:49:12
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
为什么总是有错误?哪里错了?
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绘制旋转地球体怎么做?](/uploads/image/z/16676988-60-8.jpg?t=matlab%E7%BB%98%E5%88%B6%E6%97%8B%E8%BD%AC%E5%9C%B0%E7%90%83%E4%BD%93%E6%80%8E%E4%B9%88%E5%81%9A%3F)
你让他无限循环,你关闭图形窗口,那个时候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
你然他转一定圈数停止!
比如转一百圈
function [res] = test6(r)%创建旋转的球体
t=1;
[x,y,z]=sphere(r);
h=surfl(x,y,z);
shading interp
colormap(winter)
axis equal
while t