I am trying to code a Simulink model. I am using 2 sec simulation time and my input has values against the time 0:0.1:2
The output I am getting does not seem right. For 1st time instance, input size is 1x3 and I want the output size to be 1x3 (but it is giving 21x3 size output). For the 2nd instance, 2nd input should be used and 1st output should be used for feedback.
I want the code to work just as standalone Simulink model does.
t = 0:0.1:10;
T_o = [0.05*(10-t);0.04*(10-t);0.03*(10-t)]';
T_d = zeros(size(T_o));
T_e = T_d-T_o;
Kp = 100;
Ki = 0;
Kd = 10;
Tf = 100;
c = pid(Kp,Ki,Kd,Tf);
C = [c 0 0;0 c 0;0 0 c];
T_u = lsim(C,T_e,t);
a = sim('Motor_Control','SimulationMode','normal');
out = a.get('T_l')
slx and .mat files are attached.