<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261430</link>
    <title>MATLAB Central Newsreader - plotting troubles</title>
    <description>Feed for thread: plotting troubles</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 23 Sep 2009 02:18:02 -0400</pubDate>
      <title>plotting troubles</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261430#681970</link>
      <author>makhoma Wood</author>
      <description>I'm trying to take a 2D plot and rotate it about an axis to make it a 3D plot. I have used&lt;br&gt;
&lt;br&gt;
plot(x,((BESSELJ(0,x)).^2).*((sin(pi*x)).^2),'c+-');&lt;br&gt;
&lt;br&gt;
and am trying to rotate this about the x-axis so that is makes a 3D image of it. I have tried a 3D approach using&lt;br&gt;
&lt;br&gt;
x = (BesselJ(0,(x.^2+y.^2).^(1/2))).^2.*(sin(pi*t)).^2;&lt;br&gt;
y = (BesselJ(0,(x.^2+y.^2).^(1/2))).^2.*(sin(pi*t)).^2;&lt;br&gt;
z = t;&lt;br&gt;
plot3(x, y, z); &lt;br&gt;
&lt;br&gt;
but this gives me a bunch of screwy lines that does not at all look like what I want/need. Any help/suggestions?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
~Josh</description>
    </item>
    <item>
      <pubDate>Wed, 23 Sep 2009 05:29:02 -0400</pubDate>
      <title>Re: plotting troubles</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/261430#681993</link>
      <author>Jerome Briot</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
try this :&lt;br&gt;
&lt;br&gt;
%-------------&lt;br&gt;
x = 0:.1:2;&lt;br&gt;
y = (besselj(0,x).^2).*(sin(pi*x).^2);&lt;br&gt;
&lt;br&gt;
th = linspace(0,2*pi,100);&lt;br&gt;
&lt;br&gt;
yrev = cos(th(:))*y;&lt;br&gt;
zrev = sin(th(:))*y;&lt;br&gt;
xrev = repmat(x,numel(th),1);&lt;br&gt;
&lt;br&gt;
figure&lt;br&gt;
p=plot(x,y,'r-');&lt;br&gt;
set(p,'linewidth',3)&lt;br&gt;
hold on&lt;br&gt;
surf(xrev,yrev,zrev)&lt;br&gt;
grid on&lt;br&gt;
axis equal vis3d&lt;br&gt;
%-------------&lt;br&gt;
&lt;br&gt;
Jerome</description>
    </item>
  </channel>
</rss>

