Plotting the equation and show resolution
조회 수: 3 (최근 30일)
이전 댓글 표시
Plot the magnitude (absolute value) and phase (angle) of the following function
i=sqrt(-1);
G(i*omega)= (-0.72*exp(-i*30*omega))/1+(i*50*omega);
from omega=0.001 to 1000 rad/sec.
Take sufficient points; say 1000, within the range 0.001 ≤ omega ≤ 1000 rad/sec to increase the resolution of your plots
댓글 수: 0
답변 (1개)
Kush
2023년 6월 30일
% Define the frequency range
omega = logspace(-3, 3, 1000);
% Define the function
G = @(omega) (-0.72*exp(-1*30*omega))./(1+(50*omega));
% Calculate the magnitude and phase
magnitude = abs(G(1i*omega));
phase = angle(G(1i*omega));
% Plot the magnitude figure;
semilogx(omega, magnitude);
xlabel('Frequency (rad/sec)');
ylabel('Magnitude');
title('Magnitude Plot');
% Plot the phase figure;
semilogx(omega, phase);
xlabel('Frequency (rad/sec)');
ylabel('Phase (rad)');
title('Phase Plot');
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

