how to draw multiple surfaces

Hello, i would appreciate if someone knows how to draw multiple (several) surfaces in one figure (only one surface is created using the command "surf(x,y,z)") ? also how to draw a surface and a line in the same figure ? i guess this is related with combining-joining two (several) objects in one figure ... ? Thanks.

답변 (2개)

Andrei Bobrov
Andrei Bobrov 2011년 12월 14일

2 개 추천

e.g.
sf1 = @(X,Y)sqrt(4*X.^2+3*Y.^2);
sf2 = @(X,Y)sqrt(X.^2+Y.^2);
[X,Y]=ndgrid(-2:.1:2,-2:.1:2);
figure
surf(sf1(X,Y));
hold on
surf(sf2(X,Y));
Jan
Jan 2011년 12월 14일

0 개 추천

The searched command is "hold", see help hold.
Another approach is creating the AXES object by:
AxesH = axes('NextPlot', 'add');
The default is 'NextPlot'='replace' such that inserting a new object delete already created objects.

카테고리

도움말 센터File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

질문:

2011년 12월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by