How can I plot this signal?

2 vues (au cours des 30 derniers jours)
Niloufar
Niloufar le 2 Nov 2022
I want to plot a magnitude and phase of a signal which the x coordinate is logf and y coordinate once is 20*log(abs(Av)) and once is 20*log(angle(Av)).here is my code but it doesn't plot anything.what is the ploblem?
close all;clear;clc;
gm = 0.04;
RL = 10000;
CL = 10^(-9);
f = logspace(-1,2);
Av = (-gm*RL)/(1 + RL*CL*f*1i);
%magnitude
subplot(2,1,1);
loglog(f,(abs(Av))^20);
title('magnitude');
grid on;
%phase
subplot(2,1,2);
loglog(f,(angle(Av))^20);
title('phase');

Réponse acceptée

Alan Stevens
Alan Stevens le 2 Nov 2022
Like this?
gm = 0.04;
RL = 10000;
CL = 10^(-9);
f = logspace(-1,2);
Av = (-gm*RL)./(1 + RL*CL*f*1i);
%magnitude
subplot(2,1,1);
loglog(f,(abs(Av)).^20); % Notice the dot .^
title('magnitude');
grid on;
%phase
subplot(2,1,2);
loglog(f,(angle(Av)).^20);
title('phase');
grid

Plus de réponses (1)

KALYAN ACHARJYA
KALYAN ACHARJYA le 2 Nov 2022
gm = 0.04;
RL = 10000;
CL = 10^(-9);
f = logspace(-1,2);
Av = (-gm*RL)./(1 + RL*CL*f*1i);
%magnitude
subplot(2,1,1);
loglog(f,(abs(Av)).^20);
title('magnitude');
grid on;
%phase
subplot(2,1,2);
loglog(f,(angle(Av)).^20);
title('phase');

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by