How do I get the phasor to rotate clock-wise direction?
조회 수: 2 (최근 30일)
이전 댓글 표시
f = input(' frequency in Hz >> ')
A = input(' amplitude (>0) >> ')
theta = input(' phase in degrees >> ')
omega = 2*pi*f; % frequency rad/s
tmax = 1/f; % one period of sinusoid
time = [ ]; n=0; % initialization
figure(1)
for t=0:tmax/36:tmax % loop
z=A*exp(j*(omega*t+theta*pi/180));
x=real(z); y = imag(z); % projection
time = [time t]; % sequence
subplot(121) % subplot 1 of 2
compass(x,y); % plot vector
axis('square') % square axis
subplot(122)
plot(n*tmax/36,x,'*r') % plot x point in red ’*’
axis('square');
axis([0 tmax -1.1*A 1.1*A]); grid % bounds; grid
hold on % hold current plot
if n == 0 % execute next statement when n=0
pause(1) % pause
else % if n=0 not satisfied go next statement
pause(0.1)
end % end of conditional
n = n+1; % increment
end % end loop
hold on % dismiss hold on
The user enters the frequency, amplitude and phase in degrees values and obtains a phasor graph. I am just getting the phasor graph rotating anti-clock-wise whit this code. What should I do to get a clock-wise rotating phasor graph?
Thank you for your help.
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!