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

1 view (last 30 days)
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 Comment
francisco
francisco on 20 Oct 2014
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).

Sign in to comment.

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 25 Mar 2014
s=tf('s');
p=(s+1)*(s+2)/((s+3)*(s+4)*(s+5));
bode(p);
  1 Comment
Rakesh
Rakesh on 3 Feb 2016
Edited: Rakesh on 3 Feb 2016
Other errors gone. Still i get
Error using + (line 63)
Matrix dimensions must agree.
Please advice

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!