Plotting voltage vectors to head to tail
Afficher commentaires plus anciens
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.
Réponses (1)
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))
Catégories
En savoir plus sur Vector Fields dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
