producing the magnitude of the butterworth graph

4 visualizzazioni (ultimi 30 giorni)
Hello everyone, I am trying to write some matlab code to show the magnitude of the butterworth equation of order 2.
The equation is: T(s) = 1/(s^2 + sqrt(2) +1.
Here is my matlab code: [code] %magnitude of butterworth filter characteristic frequency = 0.1:0.1:100;
w = 2*pi*frequency; s = j*w; butterworth = 1./(s.^2 + sqrt(2).*s +1); mag = abs(butterworth); plot(semilogx(freq),mag); [/code]
I want a range of frequencies from 0.1 to 100 rad/s and used the semilogx() function so that the x axis would have powers such as 10^0, 10^1 etc...
The graph is not correct however and I can not see what is wrong with it.
Thank you in advance

Risposta accettata

bym
bym il 22 Gen 2012
replace your plot(...) with
semilogx(frequency,mag);
semilog does its own plotting

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by