matlab的一个隐函数的画图出现错误,x=-5:0.1:5;y=5:0.1:5;z=-5:0.1:5; [x,y,z]=meshgrid(x,y,z); f=((x^2+(9/4)y^2+z^2-1)^3-x^2z^3-(9/80)y^2z^3); p=patch(isosurface(x,y,z,f,0)); set(p,'FaceColor','red','EdgeColor','none'); daspect([1 1 1])vie
x=-5:0.1:5;y=5:0.1:5;z=-5:0.1:5;
[x,y,z]=meshgrid(x,y,z);
f=((x^2+(9/4)y^2+z^2-1)^3-x^2z^3-(9/80)y^2z^3);
p=patch(isosurface(x,y,z,f,0));
set(p,'FaceColor','red','EdgeColor','none');
daspect([1 1 1])
view(3)
camlight; lighting phong
总是出现:
f=((x^2+(9/4)y^2+z^2-1)^3-x^2z^3-(9/80)y^2z^3);
|
Error:Missing variable or function.
I did this before, so just give you the codes I wrote, try this:
(you should use .^, .* and ./ instead of ^, * and / because you want to do operations on every element, not the matrix or vector.
%%This file creates a 3-d red heart with an equation
[x,y,z]=meshgrid(linspace(-3,3,120));
f=(x.^2+(9*y.^2)./4+z.^2-1).^3-((9*y.^2).*(z.^3))./80-(x.^2).*(z.^3);
p=patch(isosurface(x,y,z,f,0));
set(p,'FaceColor','r')
grid on
daspect([1 1 1])
view(3)
camlight('right')
camlight('left')
camlight('headlight')
lighting phong
xlabel('X')
ylabel('Y')
zlabel('Z')
title('Heart of Math')
设f(x)为连续函数,f(0)=a,F(t)=∫∫∫Ω{z-f(x^2+y^2+z^2)]dv,其 2020-06-15 …
已知光滑曲线C:x=x(t),y=y(t),z=z(t)在点(x(t0),y(t0),z(t0)) 2020-07-10 …
含有字母t,y,x,q,d的单词含有t,y,x,q,d或t,y,l,w,d的单词(词组也行,单词最 2020-07-16 …
用matlab求定积分的上限b的值定积分l=∫(x^2+y^2+z^2)^(1/2)*xd(t)上 2020-07-24 …
求柱面的方程..准线为f(x,y)=0,z=0;母线的方向向量为s={l,m,n},则柱面的方程f 2020-07-31 …
曲线x=ln(1+t²),y=arctant,z=t³在点在t=-1的一个点处的一个切向量与ox轴 2020-08-02 …
若x/(y+z+t)=y/(z+t+x)=z/(t+x+y)=t/(x+y+z)即f=(x+y)/( 2020-10-30 …
已知线L1:x=-1+t,y=3+2t,z=1-t;线L2:x=3+t,y=1-t,z=2求线L的方 2020-11-01 …
已知线L1:x=-1+t,y=3+2t,z=1-t;线L2:x=3+t,y=1-t,z=2...求线 2020-11-01 …
x=f1(s,t)y=f2(s,t)z=f3(s,t)用matlab计算出F(x,y,z)=0x=f 2020-11-01 …