How can I plot this signal?

2 Ansichten (letzte 30 Tage)
Niloufar
Niloufar am 2 Nov. 2022
Beantwortet: KALYAN ACHARJYA am 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');

Akzeptierte Antwort

Alan Stevens
Alan Stevens am 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

Weitere Antworten (1)

KALYAN ACHARJYA
KALYAN ACHARJYA am 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');

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by