Nyquist function returns error
2 views (last 30 days)
Show older comments
I get an error when trying to use the nyquist function, either with or without an argument. The error stems from a 'switch' argument having a double as an input. I have Matlab r2010a student edition with control system toolbox version 8.5 running on a 64-bit Dell Latitude E6510 with Windows 7. Please let me know if more information would be useful. The error is as follows:
num=[1 2];
den=[1 -2 -3];
h=tf(num,den)
nyquist(h)
??? SWITCH expression must be a scalar or string constant.
Error in ==> cot at 30
switch varargin{arg}
Error in ==> freqgrid>LocalResGrid at 244
ct = -cot(angles);
Error in ==> freqgrid at 102
[wnew,dlnew,drnew] = LocalResGrid(zp(:),Ts,dnpts,Grade);
Error in ==> ltidata.freqresp at 46
w = freqgrid(z,p,Ts,Grade,Focus);
Error in ==> resppack.ltisource.nyquist at 24
[mag,phase,w,FocusInfo] = freqresp(SysData(ct),1,wspec,true);
Error in ==> wavepack.waveform.draw at 21
feval(this.DataFcn{:});
Error in ==> wrfc.plot.draw at 18
draw(wf)
Error in ==> wrfc.plot.init_listeners>LocalRefreshPlot at 119
draw(this)
Warning: Error occurred while evaluating listener callback.
> In lti.nyquistplot at 103
In lti.nyquist at 83
In exresp at 40
In nyquist at 67
0 Comments
Accepted Answer
Walter Roberson
on 13 Jun 2011
The built-in cot() function does not have 30 lines or any switch statement.
Please use
which -all cot
to see if perhaps you have accidentally introduced your own cot.m that is overriding the MATLAB one.
0 Comments
More Answers (0)
See Also
Categories
Find more on Characters and Strings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!