Thread Subject: compass plot

Subject: compass plot

From: Rhys

Date: 17 Jul, 2009 15:42:01

Message: 1 of 2

% This was my other option, made a post below, but this should have been included, % is this a way forward for me?

% made up data
     x=[90, 180,330]; % <- note: row vec
     y=[-330 180 90]
 
% the plot
     h=compass(x,y);

 %actual data I wish to plot
 
 % directions (degrees)
     
     directions = [ 148.7, -64.4, 93.1, -89.2, 125.9, -59.5]
     
    % and I would like to show a SE around the arrows...
         
     SE = [2.27, 2.63, 1.96, 1.86, 1.88, 8.60]

% do I need to work out an X and Y for the directions and use the compass
% plot? Is there a better way of doing this?

Subject: compass plot

From: Samuel Dorrell

Date: 17 Jul, 2009 15:56:01

Message: 2 of 2

"Rhys " <daviesjr3*NOspam*@cardiff.ac.uk> wrote in message <h3q649$s1c$1@fred.mathworks.com>...
> % This was my other option, made a post below, but this should have been included, % is this a way forward for me?
>
> % made up data
> x=[90, 180,330]; % <- note: row vec
> y=[-330 180 90]
>
> % the plot
> h=compass(x,y);
>
> %actual data I wish to plot
>
> % directions (degrees)
>
> directions = [ 148.7, -64.4, 93.1, -89.2, 125.9, -59.5]
>
> % and I would like to show a SE around the arrows...
>
> SE = [2.27, 2.63, 1.96, 1.86, 1.88, 8.60]
>
> % do I need to work out an X and Y for the directions and use the compass
> % plot? Is there a better way of doing this?

Hi Rhys,
This should solve your problem:
SE = [2.27, 2.63, 1.96, 1.86, 1.88, 8.60];
dir = [ 148.7, -64.4, 93.1, -89.2, 125.9, -59.5];
[x,y] = pol2cart(dir*pi/180,SE);
compass(x,y)
Sam

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com