Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to plot phasors

Status
Not open for further replies.

odlanor

Electrical
Jun 28, 2009
689
I am just looking for a routine to plot a group of electrcal phasors like:
polar representation
1.00 1.00 1.00
-30.00 -150.00 90.00

or

equivalent rectangular representation
0.8660 - 0.5000i
-0.8660 - 0.5000i
0.0000 + 1.0000i
 
Replies continue below

Recommended for you

Have you looked into the compass command?
Code:
A = [0.866-0.5*i, 0.866+0.5*i, 0.000+1,0*i]'
compass(A)

//signed//
Christopher K. Hubley
Mechanical Engineer
Sunpower Incorporated
Athens, Ohio
 
The [tt]compass[/tt] function produces the same output as Phasor.m, no?

//signed//
Christopher K. Hubley
Mechanical Engineer
Sunpower Incorporated
Athens, Ohio
 
Strange... seems to work for me. Did you check you inputs to the compass function against what it's expecting? Mind you, I'm using Octave rather than Matlab, so perhaps there's a Matlab bug that I'm unaware of. Here's my test code, and I've attached the resulting plot:
Code:
clear; clc; close all;
A = [0.8660 - 0.5000*i;  -0.8660 - 0.5000*i;  0.0000 + 1.0000*i];
B = [  1,    1,  1];
C = [-30, -150, 90];

h = figure(1);
subplot(2,2,1);
compass(A);
title('Compass Function Plotting Rectangular Representation');

subplot(2,2,2);
Phasor(A);
title('Phasor Function Plotting Rectangular Representation');

subplot(2,2,3);
U = B.*cos(C.*pi/180);
V = B.*sin(C.*pi/180);
compass(U,V);
title('Compass Function Plotting Polar Representation');

subplot(2,2,4);
Phasor([B;C]');
title('Phasor Function Plotting Polar Representation');

W = 5; H = 4;
set(h,'PaperUnits','inches')
set(h,'PaperOrientation','portrait');
set(h,'PaperSize',[H,W])
set(h,'PaperPosition',[0,0,W,H])
FS = findall(h,'-property','FontSize');
set(FS,'FontSize',6);
print(h,'-dpng','Phasor-v-compass.png')

//signed//
Christopher K. Hubley
Mechanical Engineer
Sunpower Incorporated
Athens, Ohio
 
 http://files.engineering.com/getfile.aspx?folder=2e526bbe-53ba-4d27-86a7-749a550cea9e&file=Phasor-v-compass.png
flash3780,
I make mistake.you´re all right.
I am not expert in matlab.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor