Azzera filtri
Azzera filtri

surface evolution of 2 arrays in 3D

2 visualizzazioni (ultimi 30 giorni)
K.
K. il 26 Feb 2014
Commentato: K. il 26 Feb 2014
I would like your help. I am newbie in MATLAB. In my program I calculate 2D plot profiles as the attached pic.
on this Y-X 2D plot, the Y array being calculated for 10 time steps. I would like to make a surface evolution of all this plots around x=0; at least for the last one. Eventually to create a surface 3Dplot, like a half sphere. The Z axis could be the same as X axis; so the radius to be from 0 to 1 according the attached pic. Please, can someone help me on this? Any idea is more than welcome. thank you.

Risposta accettata

Mischa Kim
Mischa Kim il 26 Feb 2014
Konstantinos, try this one:
R = 0:0.1:1;
z = cos(-R); % that'd be your current y-function
th = 0:pi/20:2*pi;
X = bsxfun(@times,R',cos(th));
Y = bsxfun(@times,R',sin(th));
Z = repmat(z',1,length(th));
surf(X,Y,Z)
box
  6 Commenti
Mischa Kim
Mischa Kim il 26 Feb 2014
Yep, see updated code above.
set(gca,'zlim',[0 1],'ylim',[-5 5]) % keep limits on z and y axis
Does this answer your questions?
K.
K. il 26 Feb 2014
Yes! I did not try the above answer yet, cause I have two parts on my code. Thank you!!!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Animation in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by