how to draw multiple surfaces
Show older comments
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.
Answers (2)
Andrei Bobrov
on 14 Dec 2011
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
on 14 Dec 2011
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.
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!