How to generating surface without plotting?
22 views (last 30 days)
Ameer Hamza on 30 Dec 2020
Since it is a graphical object, you cannot create it without plotting somewhere. However, you can make the figure invisible so that it does not appear on screen
[x, y, z] = ellipsoid(3,3,5,1,0.5,0.5)
f = figure('Visible', 'off');
ax = axes(f);
s = surf(ax,x,y,z)
direction = [rand() rand() rand()];
More Answers (1)
Cris LaPierre on 30 Dec 2020
If I look at the first example on the surf documentation page, it first creates X, Y and Z, then uses surf to plot/create the surface. So is what you want X,Y and Z?
% Example modified to create surface data but not the surface
[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);