Control systems failing to plot

조회 수: 2 (최근 30일)
Daniel Altschuler
Daniel Altschuler 2022년 1월 14일
댓글: Star Strider 2022년 1월 14일
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.

답변 (2개)

David Sanchez
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.

Star Strider
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
Daniel Altschuler
Daniel Altschuler 2022년 1월 14일
편집: Daniel Altschuler 2022년 1월 14일
unfortunately it hasn't helped
thank you though :)
Star Strider
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Frequency-Domain Analysis에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by