Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Help needed for looping in simulink
1 回表示 (過去 30 日間)
古いコメントを表示
So basically I have a matrix of size 4X4X640 and I have written a loop something like this :
for i = 1:640
qd = [A2(1,4,i);A2(2,4,i);0;A2(3,4,i)]';
qd_dot = [0;0;0;0]';
e=q'-qd; %Tracking Error
e_dot=q_dot'-qd_dot;
Tau=-(k1*e)-(k2*e_dot); % Controller
end
Here q is being genereated automatically by simulink using integrators and qd is my desired Trajectory. here Matrix A is 4x4x640. What I want is that in a timespan of 20 Seconds q-qd operation takes places and it generates a time varying error signal.
Right now the error is that qd is just taking the last value of the matrix size. What am I missing? q should be generated automatically but the size won't by 640. Should I convert it to a time series?
0 件のコメント
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!