From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How rotate a dscrete 2D curve around the Y axis for obtaining the surface?
Date: Fri, 18 Jun 2010 23:54:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <hvh0us$bj9$>
References: <hvfu5l$gg0$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1276905244 11881 (18 Jun 2010 23:54:04 GMT)
NNTP-Posting-Date: Fri, 18 Jun 2010 23:54:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:646312

"Yung Olivier" <> wrote in message <hvfu5l$gg0$>...
> Hey everybody:
>    Now there is a 1×100 array&#65292;using plot(), we can get its curve, but how to obtain its surface with rotating around Y  axis?
>   Thank you very much!

  If you were plotting an x-array against a y-array, then you can do this:

 n = 100;
 [rho,theta] = meshgrid(x,linspace(0,2*pi,n));
 Z = repmat(y(:).',n,1);
 X = rho.*cos(theta);
 Y = rho.*sin(theta);

In the surface here the curve will be rotated about the z-axis of the three-dimensional surf space.

  If instead you were plotting y against its own index, just use x = 1:m in the above where m is the length of y.

Roger Stafford