how can I plot this function ?

3 次查看(过去 30 天)
Marcin Piasecki
Marcin Piasecki 2019-11-12
回答: KSSV 2019-11-12
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
"

回答(1 个)

KSSV
KSSV 2019-11-12
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");

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by