getting data from workspace to Simulink

Illustration
Eshkabilov - 2021-09-23T14:21:09+00:00
Question: getting data from workspace to Simulink

Hello guys,   I have a simulink file that is basically giving as output the control signal of many switches "1" and "0", I took the outputs of the clock, and all the data to workspace using "simout" as array, and all the arrays (time, command of all switches) have the same size (320).   Now I am trying to use in a different simulink model these outputs from workspace in order to simulate my model, I am getting the following error for all the "simin" from workspace :   "Invalid matrix variable specified as workspace input in 'untitled4/From Workspace'. The matrix data must be a real, double, have two dimensions, and at least two columns. The first column must contain time values and the remaining columns the data values. Matrix values cannot be Inf or NaN."   Can You please suggest a solution for my problem

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

Hi,
 
In this case, you'd need to generate two column data from your imported data ([To Woskspace] block) into matlab workspace, e.g.:
DATA = out.simout;   % From your alread imported data from the 1st Simulink model
Now, in your [Simin], specify the input variable name: DATA
 
Run your new Simulink model.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!