# How to make semilogx to get a plot gain against log frequency with several values? [beginner] [closed] Gain: 20 log (Vout/Vin) with Vin = 1.0. I've been searching for gain values: a. -156.48 dB b. -80 dB c. -53.98 dB d. -13.98 dB e. 3.52 dB f. 10.32 dB g. 13 dB h. 13.93 dB i. 13.96 dB j. 13.98 dB

I am still at the very start on this semester to learn about matlab. How to make semilogx to get a plot gain against log frequency with several values? I've been searching matlab tutorial but I still got no clues. If anyone could give some explainations or examples relate with this question, please tell me. I want to learn about it. Thank you.

I usually don't do homework for people

clc
clear all
close all
%%
freqs=[   2    10    20   60 100 125  150  200  300 400];
Vo=[.15e-7 .1e-3 .002 .2  1.5 3.28 4.47 4.97 4.99 5];
G=[ -156.48  -80  -53.98  -13.98  3.52  10.32  13  13.93  13.96  13.98];
%%
% G=20*log10(Vo/Vin)  -> G/20=log10(Vo/Vin) -> 10.^(G/20)=(Vo/Vin)  ->
% Vin=Vo.*10.^(-(G/20))
Vin=Vo.*10.^(-(G/20));

semilogx(freqs,Vin,'x',freqs,Vo,'o')
legend('V_{in}','V_{out}')
xlabel('frequency in Hz')
ylabel('Volts RMS') • do u have any recommendations about matlab tutorial for beginner? Thank you so much. – Evangelina Tessia P Aug 17 '18 at 4:30
• The math works has training material and some universities have tutorials – user28715 Aug 17 '18 at 6:43