Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Help needed for looping in simulink

1 visualizzazione (ultimi 30 giorni)
Pranjal Bhatia
Pranjal Bhatia il 12 Nov 2020
Chiuso: MATLAB Answer Bot il 20 Ago 2021
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?

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by