Nyquist function returns error

8 vues (au cours des 30 derniers jours)
Daniel Zwart
Daniel Zwart le 13 Juin 2011
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

Réponse acceptée

Walter Roberson
Walter Roberson le 13 Juin 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.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by