producing the magnitude of the butterworth graph

2 次查看(过去 30 天)
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

采纳的回答

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

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by