Control systems failing to plot
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
David Sanchez
2022-1-14
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.
0 个评论
Star Strider
2022-1-14
The only thing I can think of is to try these:
restoredefaultpath
% savepath % <— MAY NOT BE NECESSARY
rehash toolboxcache
.
2 个评论
Star Strider
2022-1-14
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!