I want to change A and B values when the sampling time comes and do subtraction operation on Simulink.
The vectors A and B, as well as the sampling time, are created in the workspace. I add them to Simulink with Constant Blocks.
A = [ 3 5 7 9 ] , B = [1 2 3 4 ] , Ts= 0.1
On the right side of the figure, it can be seen that the Output is 4 parallel data (Data1 , Data2 , Data3 , Data4) when the sampling time comes. But I just want to give all datas of A and B with serial respect to sampling rate and just observe OUTPUT = Data1 on the table. Please Help me.
In Example: A = A[1] = 3 , B = B[1] = 1 at Time = 0
A = A[2] = 5 , B = B[2] = 2 at Time = 0.1 = 1*Ts
A = A[3] = 7 , B = B[3] = 3 at Time = 0.2 = 2*Ts
A = A[4] = 9 , B = B[4] = 4 at Time = 0.3 = 3*Ts
Best Answer