matlab的rotate语句出错,不会转动
figure(2)colormap('flag');n=100;x=linspace(-3,3,n);y=linspace(-3,3,n);z=linspace(-3,3...
figure(2)
colormap('flag');
n=100;
x=linspace(-3,3,n);
y=linspace(-3,3,n);
z=linspace(-3,3,n);
[X,Y,Z]=ndgrid(x,y,z);
F=(X.^2+(9/4) .* (Y.^2)+Z.^2-1).^3-X.^2 .* Z.^3-(1/9) .* Y.^2 .* Z.^3
isosurface(F,0)
axis equal
view([55 34]);
title('旋转的心形_三维心形函数')
axis off
t=1
while 1,t<10000,t=t+1
rotate(F,[0,0,1],3)
drawnow
end
rotate语句实现不了。心形做出来了,可是不会转动。
报错rotate(F,[0,0,1],3) 展开
colormap('flag');
n=100;
x=linspace(-3,3,n);
y=linspace(-3,3,n);
z=linspace(-3,3,n);
[X,Y,Z]=ndgrid(x,y,z);
F=(X.^2+(9/4) .* (Y.^2)+Z.^2-1).^3-X.^2 .* Z.^3-(1/9) .* Y.^2 .* Z.^3
isosurface(F,0)
axis equal
view([55 34]);
title('旋转的心形_三维心形函数')
axis off
t=1
while 1,t<10000,t=t+1
rotate(F,[0,0,1],3)
drawnow
end
rotate语句实现不了。心形做出来了,可是不会转动。
报错rotate(F,[0,0,1],3) 展开
1个回答
展开全部
句柄不对,改好了。
你的心好酷呀呵呵
clf;
close all;
clear all;
figure(2)
colormap('flag');
n=100;
x=linspace(-3,3,n);
y=linspace(-3,3,n);
z=linspace(-3,3,n);
[X,Y,Z]=ndgrid(x,y,z);
F=(X.^2+(9/4) .* (Y.^2)+Z.^2-1).^3-X.^2 .* Z.^3-(1/9) .* Y.^2 .* Z.^3;
isosurface(F,0);
axis equal
view([55 34]);
title('旋转的心形_三维心形函数')
axis off
h = allchild(gca);
t=1
while t<10000,t=t+1
rotate(h,[0,0,1],3);
drawnow;
end
你的心好酷呀呵呵
clf;
close all;
clear all;
figure(2)
colormap('flag');
n=100;
x=linspace(-3,3,n);
y=linspace(-3,3,n);
z=linspace(-3,3,n);
[X,Y,Z]=ndgrid(x,y,z);
F=(X.^2+(9/4) .* (Y.^2)+Z.^2-1).^3-X.^2 .* Z.^3-(1/9) .* Y.^2 .* Z.^3;
isosurface(F,0);
axis equal
view([55 34]);
title('旋转的心形_三维心形函数')
axis off
h = allchild(gca);
t=1
while t<10000,t=t+1
rotate(h,[0,0,1],3);
drawnow;
end
追答
我用的是2007b版本,运行的挺好的呀。你再试试这个:
clf;
close all;
clear all;
figure(2)
colormap('flag');
n=100;
x=linspace(-3,3,n);
y=linspace(-3,3,n);
z=linspace(-3,3,n);
[X,Y,Z]=ndgrid(x,y,z);
F=(X.^2+(9/4) .* (Y.^2)+Z.^2-1).^3-X.^2 .* Z.^3-(1/9) .* Y.^2 .* Z.^3;
isosurface(F,0);
axis equal
view([55 34]);
title('旋转的心形_三维心形函数')
axis off
h = allchild(gca);
t=1
for t=1:10000
rotate(h,[0,0,1],3);
drawnow;
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询