Prev: how to use textscan in a for loop with header lines increasing
Next: local maxima lines:MATLAB CODE
From: DRG on 1 Mar 2010 14:52 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..
From: Walter Roberson on 1 Mar 2010 14:51 DRG wrote: > 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.. 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).
From: DRG on 2 Mar 2010 12:08 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? On Mar 1, 7:51 pm, Walter Roberson <rober...(a)hushmail.com> wrote: > DRG wrote: > > 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.. > > 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).
From: Lorenzo Guerrasio on 2 Mar 2010 12:23 COuld you provide some lines representing your code? It is difficoult to understand what it might be wrong,otherwise. DRG <grimesd2(a)gmail.com> wrote in message <13e90a7d-268f-4ace-81e2-5b8bcec973cb(a)m37g2000yqf.googlegroups.com>... > 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? > > On Mar 1, 7:51 pm, Walter Roberson <rober...(a)hushmail.com> wrote: > > DRG wrote: > > > 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.. > > > > 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).
From: Walter Roberson on 2 Mar 2010 13:13 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.)
|
Next
|
Last
Pages: 1 2 Prev: how to use textscan in a for loop with header lines increasing Next: local maxima lines:MATLAB CODE |