Plotting the equation and show resolution

1 次查看(过去 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

回答(1 个)

Kush
Kush 2023-6-30
You can use anonymous function to implement the above like this:
% 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');

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by