如何用matlab画爱心
2个回答
展开全部
[x,y,z]=meshgrid(linspace(-2,2));
f=@(x,y,z)(x.^2 + (9/4)*y.^2 + z.^2 - 1).^3 - x.^2.*z.^3 - (9/80)*y.^2.*z.^3;
p=patch(isosurface(x,y,z,f(x,y,z),0));
view(3);
axis equal
set(p,'FaceVertexCData',jet(size(get(p,'faces'),1)) ,'FaceColor', 'flat', 'EdgeColor', 'none');
f=@(x,y,z)(x.^2 + (9/4)*y.^2 + z.^2 - 1).^3 - x.^2.*z.^3 - (9/80)*y.^2.*z.^3;
p=patch(isosurface(x,y,z,f(x,y,z),0));
view(3);
axis equal
set(p,'FaceVertexCData',jet(size(get(p,'faces'),1)) ,'FaceColor', 'flat', 'EdgeColor', 'none');
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询