Info

This question is closed. Reopen it to edit or answer.

Trying to plot vectors and then rotate one

1 view (last 30 days)
Michael
Michael on 13 Mar 2013
Closed: Sabin on 23 Dec 2022
I am trying to set up a phasor viewer, for my own use. I am not getting what I expected as far as the plots are concerned.
What I want is for example threephasev(10,45) should give two vectors, one from the origin to (10,0) and the other rotated by 45 degrees.
I might have issues with the ordering in the matrices.
Thank you, Mick
if true
function [ output_args ] = threephasev( A,theta )
%threephasev A (magnitude) theta (phase angle)
% Plots the phasor of a the phase source
% Michael Carey
% Student Deakin University
% 400100801
% mpc.tab4(nospam)@gmail.com
% 12/3/2013
a = [ 0 0 ; A 0 ];
quiver(a(1),a(3),a(2),a(4));
% a(1) % a(3) % a(2) % a(4)
R=[ cosd(theta),-sind(theta) ; sind(theta),cosd(theta)];
b = R*a; hold on quiver(b(1),b(3),b(2),b(4));
end

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!