フィルターのクリア

How do I get the phasor to rotate clock-wise direction?

2 ビュー (過去 30 日間)
Kutlu Yigitturk
Kutlu Yigitturk 2021 年 3 月 1 日
コメント済み: Kutlu Yigitturk 2021 年 3 月 1 日
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.
  1 件のコメント
Kutlu Yigitturk
Kutlu Yigitturk 2021 年 3 月 1 日
Solution Found
We need to swap x and y in "compass (x, y);% plot vector" line.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by