
plot x^2+y^3+z^4=1
23 ビュー (過去 30 日間)
古いコメントを表示
I want to plot x^2+y^3+z^4=1 for (x>0, y>0, z>0) but don't quite know how to do it. I have tried the following:
x = 0:0.1:2;
y = x;
z = y;
[X,Y,Z] = meshgrid(x,y,z);
Z = nthroot(1-(Y.^2)-(Z.^3),4);
surf(X,Y,Z)
But i get the following error message:
Error using nthroot (line 31)
If X is negative, N must be an odd integer.
Error in Raknestuga_3_problem_2_c (line 9)
Z = nthroot(1-(Y.^2)-(Z.^3),4);
Any ideas?
0 件のコメント
回答 (1 件)
John D'Errico
2017 年 9 月 16 日
編集済み: John D'Errico
2017 年 9 月 16 日
You only need to go as high as 1 for a solution to exist. Beyond that point in x, y, or z, you are raising a number greater than 1 to a power. The sum could never equal 1.
v = 0:0.01:1;
[X,Y,Z] = ndgrid(v,v,v);
p = patch(isosurface(X,Y,Z,X.^2 + Y.^3 + Z.^4,1))
p.FaceColor = 'green';
p.EdgeColor = 'none';
camlight; lighting phong
xlabel 'X'
ylabel 'Y'
zlabel 'Z'

0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!