how can I plot this function ?

3 vues (au cours des 30 derniers jours)
Marcin Piasecki
Marcin Piasecki le 12 Nov 2019
Réponse apportée : KSSV le 12 Nov 2019
Hi
I just started wit matlab, and I trying to plot this function by semilogx , but noting happend, how I can do that ?
"
function part 3
R1=1000 %Ohm%
C1=0.000000032;%F%
R2=1000 %Ohm%
C2=0.000000032;%F%
x=linspace(0,100,100)
function y=f(x)
y= 20*log(abs(1/(R1*R2*C1*C2))/((2*pi*(x))*(2*pi*(x))+(2*pi*(x))*(1/(R1*C1))+(1/(R2*C1))*(1/(R2*C2))))
semilogx (x,y);
xlabel("frequency");
ylabel("y(x)");
title("x");
end
end
"

Réponses (1)

KSSV
KSSV le 12 Nov 2019
Read about matlab element by element operations:
R1=1000 %Ohm%
C1=0.000000032;%F%
R2=1000 %Ohm%
C2=0.000000032;%F%
x=linspace(0,100,100)
y= 20*log(abs(1./(R1*R2*C1*C2))./((2*pi*(x)).*(2*pi*(x))+(2*pi*(x)).*(1/(R1*C1))+(1/(R2*C1))*(1/(R2*C2)))) ;
semilogx (x,y);
xlabel("frequency");
ylabel("y(x)");
title("x");

Community Treasure Hunt

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

Start Hunting!

Translated by