How to plot this 3d graph?

조회 수: 1 (최근 30일)
Michele
Michele 2013년 4월 9일
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?

채택된 답변

Jonathan Epperl
Jonathan Epperl 2013년 4월 9일
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
Michele
Michele 2013년 4월 10일
many thanks Jonathan.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by