Plotting voltage vectors to head to tail
2 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
KSSV
on 15 Sep 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))
0 Comments
See Also
Categories
Find more on Vector Fields in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!