Control systems failing to plot

2 views (last 30 days)
Daniel Altschuler
Daniel Altschuler on 14 Jan 2022
Commented: Star Strider on 14 Jan 2022
Every time I try to use Bode or Nyquist it fails to provide me a plot. I am using the syntax correctly, it works fine on my collegues pc.
I have since uninstalled and installed both Matlab and Control Systems Toolbox.
I am providing a very small code that does not work.
%----------my code
s = tf('s');
GH = 1/(s*(s^2+s+4));
bode(GH)
% ---------the errors I get
Index in position 1 exceeds array bounds.
Error in poly (line 5)
a=cord(1:2,1);
Error in freqgrid>LocalAddPhaseExtrema (line 334)
num = poly(z);
Error in freqgrid (line 138)
w = LocalAddPhaseExtrema(w,z{1},p{1});
Error in ltipack.ltidata/freqresp (line 45)
w = freqgrid(z,p,Ts,Grade,Focus);
Error in resppack.ltisource/magphaseresp (line 36)
[mag,phase,w,FocusInfo] = freqresp(SysData(ct),grade,wspec,true);
Error in wavepack.waveform/draw (line 25)
feval(this.DataFcn{:});
Error in wrfc.plot/draw (line 17)
draw(wf)
Error in wrfc.plot/init_listeners>LocalRefreshPlot (line 79)
draw(this)
Warning: Error occurred while evaluating listener callback.
> In DynamicSystem/bodeplot (line 142)
In DynamicSystem/bode (line 94)
>>
I've been trying to fix this for a few days now and I am just stuck.

Answers (2)

David Sanchez
David Sanchez on 14 Jan 2022
Hi Daniel, your problem has definitely to do with your PC for sure. As you mention, the code works in your colleagues machines (I also try in different PCs and it works) and as such, it's not a coding issue. Sometimes not having the right reading privileges to some folders ends up in errors, but I assume you have full read-write access to your whole system. Also, make sure matlab contemplates the location of all those functions in its path.

Star Strider
Star Strider on 14 Jan 2022
The only thing I can think of is to try these:
restoredefaultpath
% savepath % <— MAY NOT BE NECESSARY
rehash toolboxcache
.
  2 Comments
Daniel Altschuler
Daniel Altschuler on 14 Jan 2022
Edited: Daniel Altschuler on 14 Jan 2022
unfortunately it hasn't helped
thank you though :)
Star Strider
Star Strider on 14 Jan 2022
My pleasure!
Please Contact Support to see if they can help. Include the URL of this thread in your message to them so that they know the steps already taken.

Sign in to comment.

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!