Plotting voltage vectors to head to tail

2 visualizzazioni (ultimi 30 giorni)
Daniel Williams
Daniel Williams il 14 Set 2022
Risposto: KSSV il 15 Set 2022
I am trying to plot voltage vectors to form a power triangle.
A = [Vs;Irc;Vrrc;Vcrc];
Ive arranged my complex numbers into an array and plot them using
quiver(zeros(size(A,1),1),zeros(size(A,1),1),real(A), imag(A), 0);
This plots all vectors starting from the origin.
However, I would like to plot these vectors in a head to tail fashion such that Vrrc starts from the origin and Vcrc starts from the end of Vrrc.

Risposte (1)

KSSV
KSSV il 15 Set 2022
Vs = rand(1,2) ;
Irc = rand(1,2) ;
Vrrc = rand(1,2) ;
Vcrc = rand(1,2) ;
A = [Vs;Irc;Vrrc;Vcrc];
% GEt coordinates
P = zeros(4,2) ;
for i = 2:4
r = norm(A(i-1,:)) ;
theta = atan2(A(i-1,2),A(i-1,1)) ;
P(i,:) = P(i-1,:)+[r*cos(theta) r*sin(theta)] ;
end
quiver(P(:,1),P(:,2),A(:,1),A(:,2))

Categorie

Scopri di più su Vector Fields in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by