producing the magnitude of the butterworth graph
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Akzeptierte Antwort
bym
am 22 Jan. 2012
replace your plot(...) with
semilogx(frequency,mag);
semilog does its own plotting
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!