
plot x^2+y^3+z^4=1
20 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
John D'Errico
el 16 de Sept. de 2017
Editada: John D'Errico
el 16 de Sept. de 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 comentarios
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!