I can't plot transfer functions higher than 3. order with command "bode"!

I define a transfer function and want to plot it with command bode as follows:
t=tf('s');
p=(s+1)*(s+2)/((s+3)*(s+4)*(s+5));
bode(p);
this gives me the following errors:
Error using .*
Matrix dimensions must agree.
Error in freqgrid>LocalAddPhaseExtrema (line 342)
d1 = den(end:-2:1); d1 = fliplr(d1 .* altsgn(1:length(d1)));
Error in freqgrid (line 139)
w = LocalAddPhaseExtrema(w,z{1},p{1});
Error in ltipack.ltidata/freqresp (line 46)
w = freqgrid(z,p,Ts,Grade,Focus);
Error in resppack.ltisource/magphaseresp (line 35)
[mag,phase,w,FocusInfo] = freqresp(SysData(ct),grade,wspec,true);
Error in wavepack.waveform/draw (line 26)
feval(this.DataFcn{:});
Error in wrfc.plot/draw (line 18)
draw(wf)
Error in wrfc.plot/init_listeners>LocalRefreshPlot (line 122)
draw(this)
Warning: Error occurred while evaluating listener callback.
> In DynamicSystem.bodeplot at 141
In DynamicSystem.bode at 96
when I define p as a function of only second order the above code works without problem! what am I doing wrong? may I change any settings somewhere? (I use matlab version R2013b)

1 个评论

I'm having this error too, did you fixed it? it doesn't even work with the example code of the "bode" function (for an 3 order transfer fuction).

请先登录,再进行评论。

回答(1 个)

s=tf('s');
p=(s+1)*(s+2)/((s+3)*(s+4)*(s+5));
bode(p);

1 个评论

Other errors gone. Still i get
Error using + (line 63)
Matrix dimensions must agree.
Please advice

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Dynamic System Models 的更多信息

编辑:

2016-2-3

Community Treasure Hunt

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

Start Hunting!

Translated by