I am trying to control motor torque and am using a workspace variable in Simulink and want to output similar variable to workspace.
I have size(T_u)=[3, 91] whereas the output I am getting from the simulation has size [101, 90]
I am unable to understand why this is so.
Code that I am using:
t = 1: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);
C_PD = pid(100,0,10,100);
T_u = zeros(size(T_e));
T_u(k,:) = lsim(C_PD,T_e(k,:),t);
T_l = zeros(size(T_u));
C_PI = pid(10,1000,0);
a = sim('Motor_Control','SimulationMode','normal');
out = a.get('T_l')
.mat and .slx files are attached.