In the Simulink environment, I encountered a problem that I want to create a discrete viewer using the MATLAB function and I did this with the for-loop. The problem is that function inputs, which are discrete signals, are not arrays and will be 1 by 1. Someone can help me?
function wr = fcn(ia,ib,va,vb)
I=[1 0;0 1];
J=[0 -1;1 0];
wr=wr0+0.2*(i_a - ia(i))*psi_a;
[i_a;i_b;psi_a;psi_b] == [I+0.1 0.5*I+0.9*wr;J+1*I J*wr+0.2*I]*[i_a;i_b;psi_a;psi_b] ...
+[I*800;0*I]*[va(i);vb(i)] - [2*I-1*J;wr*I-0.2*J]*[ia(i);ib(i)];
wr0 = wr;