Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Help needed for looping in simulink

조회 수: 1 (최근 30일)
Pranjal Bhatia
Pranjal Bhatia 2020년 11월 12일
마감: MATLAB Answer Bot 2021년 8월 20일
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개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by