How to plot this 3d graph?

5 visualizaciones (últimos 30 días)
Michele
Michele el 9 de Abr. de 2013
Hi to all. How can i plot the graph of z=x^3+y^3+3xy with two lines colored: one described by x=0 and the other described by y=0 , both included in the function graph?

Respuesta aceptada

Jonathan Epperl
Jonathan Epperl el 9 de Abr. de 2013
Plot the whole graph with mesh or surf, then hold on, then use plot3 to plot the lines you'd like to emphasize:
x = linspace(-3,3);
[X,Y] = meshgrid( x );
mesh(X,Y, X.^3 + Y.^3+ 3*X.*Y);
hold on;
plot3(x*0, x, x.^3,'r','LineWidth',4);
plot3(x, x*0, x.^3,'r','LineWidth',4);
hold off;
  1 comentario
Michele
Michele el 10 de Abr. de 2013
many thanks Jonathan.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by