Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: plotting troubles
Date: Wed, 23 Sep 2009 05:29:02 +0000 (UTC)
Organization: Laboratoire de Biomecanique-CHU Purpan
Lines: 24
Message-ID: <h9cbmu$p2p$1@fred.mathworks.com>
References: <h9c0gq$9n$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1253683742 25689 172.30.248.38 (23 Sep 2009 05:29:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 23 Sep 2009 05:29:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 492531
Xref: news.mathworks.com comp.soft-sys.matlab:572246


Hi,

try this :

%-------------
x = 0:.1:2;
y = (besselj(0,x).^2).*(sin(pi*x).^2);

th = linspace(0,2*pi,100);

yrev = cos(th(:))*y;
zrev = sin(th(:))*y;
xrev = repmat(x,numel(th),1);

figure
p=plot(x,y,'r-');
set(p,'linewidth',3)
hold on
surf(xrev,yrev,zrev)
grid on
axis equal vis3d
%-------------

Jerome