Error simple program PID
2 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
JOJO
2014 年 1 月 15 日
1 件のコメント
Mischa Kim
2014 年 1 月 15 日
Type
which -all syms
and you should get something like
C:\Program Files\MATLAB\R2013b\toolbox\symbolic\symbolic\syms.m
その他の回答 (5 件)
Mischa Kim
2014 年 1 月 15 日
Interesting. The code is just fine.
Try this: copy-and-paste the code from your question above and paste it into the MATLAB command window. Execute.
1 件のコメント
Mischa Kim
2014 年 1 月 15 日
Also, please post comments as comments.
David Sanchez
2014 年 1 月 15 日
I tried your code (copy-paste) and it works. Make sure you have the Symbolic Math toolbox:
Start (bottom left corner)-> Toolboxes
You should see the all the toolboxes of your system, if you do not locate the Symbolic Math toolbox, you can not use
syms
0 件のコメント
Carla
2014 年 1 月 15 日
Is there a reason you need to do this with syms? At least in the code you showed, it doesn't look like you are using any Symbolic Toolbox functionality. You can achieve the same exact result using only Control System Toolbox as follows:
num=1; % Numerator
den=[1,3,1]; % Denominator
G=tf(num,den); % Transfer Function
H=1; % Negative Feedback Loop with Unity Feedback
Kp=1; % Increment these three varaibles to give desired output
Ki=0;
Kd=0;
C=pid(Kp,Ki,Kd); % Controller Function
T=feedback(C*G,H); % C in series with G with negative feedback H
step(T) % Step Response with Controller
If there is some reason elsewhere in your program that you need syms functionality, I suppose this won't solve your problem!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!