Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Circular or polar plots in matlab problem..

110 views
Skip to first unread message

DRG

unread,
Mar 1, 2010, 2:52:23 PM3/1/10
to
Hey all;

I have a 1 x 360 array of a function I have computed in one degree
increments from a model in the lab. I want to use matlab to display
this in a circular plot to show varying intensity with angular
displacement, however I cannot seem to get my function to work
properly with the polar plot function; I should have one full circle
of values with one every one degree, however polar plot does not seem
to do this at all. I suspect my argument should be in radians instead
of degrees but surely there is a way to get it to display my data in a
circular diagram ? The data has a max of 60.5 and a min of 8.1..

Thanks in advance..

Walter Roberson

unread,
Mar 1, 2010, 2:51:08 PM3/1/10
to
DRG wrote:

Yes, you need to provide radians instead of degrees for the angles for polar
plots. You can use

degreestoradians = linspace(0,2*pi,361);

then provide the polar() function with either degreestoradians(1:end-1) or
degreestoradians(2:end) depending on whether you want your first point to be
at angle 0 degrees (ending at 359) or if you want your first point to be at
angle 1 degree (ending at 360).

DRG

unread,
Mar 2, 2010, 12:08:39 PM3/2/10
to
Thanks Walter.. that still doesn't seem to be working for me though;
It now displays something but not what it should. Surely there should
be a single value at every angular position from 0 - 360 if it's
working right ? It seems to repeat the values a lot and instead of
having single points, it goes over itself and has a spider web effect.
Any ideas?

Lorenzo Guerrasio

unread,
Mar 2, 2010, 12:23:04 PM3/2/10
to
COuld you provide some lines representing your code?
It is difficoult to understand what it might be wrong,otherwise.

DRG <grim...@gmail.com> wrote in message <13e90a7d-268f-4ace...@m37g2000yqf.googlegroups.com>...

Walter Roberson

unread,
Mar 2, 2010, 1:13:24 PM3/2/10
to
DRG wrote:
> Thanks Walter.. that still doesn't seem to be working for me though;
> It now displays something but not what it should. Surely there should
> be a single value at every angular position from 0 - 360 if it's
> working right ? It seems to repeat the values a lot and instead of
> having single points, it goes over itself and has a spider web effect.
> Any ideas?

You could get that effect if any of the values to be plotted are
negative or complex, or if you reversed the order of the parameters.

Beyond that... a bit later I'll do a small experiment to verify that my
logic was correct (I'm not by my matlab machine at the moment.)

Walter Roberson

unread,
Mar 2, 2010, 2:34:51 PM3/2/10
to

Logic checked... linspace(0,2*pi,361) as the angle works fine for 0 to 360
degrees (inclusive) in 1 degree steps.

For example,
d = linspace(0,2*pi,361);
polar(d,abs(sin(d)));

should give you two circles.

0 new messages