getting data from workspace to Simulink

E
Eshkabilov · Sep 23, 2021 · 2.7K views
Question
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 PhD Expert
Answered Aug 13, 2026
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.
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!