0

I am a begginer at Simulink. Before running the simulink project I initialize this two variables: T = [0 1]; A = [0 3 4 5]; This is the simulink process enter image description here

And this is the matlab function

[y,To] = fcn(u,t)
 y =[0 ; u+t]; 
To=[0   t+1];

As can be seen the variables A and T are obtained from the workspace, and the new calculated values are displayed and saved again on the workspace at the same variables. If I run the simulink project, the entire process is only executed once, but I am looking for the process to be on a loop, extracting, displaying and saving the variables A and T from the workspace like in real time until the simulation achieve the stop time.

JPgiq
  • 74
  • 9
  • Write a for loop then. You can call simulink fucntions from matlab scripts. – Ander Biguri May 08 '20 at 16:07
  • Why is extracting and saving during the simulation relevant? Do you plan to manipulate the workspace parameters by some other means than simulink? As documented the "toWorkspace" does not write through but buffers "During simulation, the block writes data to an internal buffer." Guess this is what you are struggling with. – Daniel May 10 '20 at 10:10

0 Answers0