
plot x^2+y^3+z^4=1
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
John D'Errico
le 16 Sep 2017
Modifié(e) : John D'Errico
le 16 Sep 2017
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 commentaires
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!