Search code examples
matlabsimulationsimulink

Simulink does not load data from .mat file


I am trying to load my data into my simulation model from .mat file in Simulink with "From file" block. I am using Matlab 2012a. My data file is one dimensional vecor of real numbers (type double) with dimensions 1x200.

When I run my simulation I am getting following error: Simulation error

In Matlab preferences, I have already set the setting "Save MAT-files that can be loaded in" to option "Matlab version 7.3, or later", but this does not work. I have also tested this approach without success: http://www.mathworks.com/matlabcentral/answers/47422-simulink-does-not-support-loading-the-input-data-in-file
I would be thankful for any ideas.


Solution

  • As per the documentation in the From File block help (obtained by pressing the Help button on the block dialog):

    Matrix format can be used only for vector, double, noncomplex  signals. Each
    column of the matrix must have a time stamp in the first row and a vector
    containing the corresponding data sample in the subsequent rows.
    

    Your 1x200 vector does not match this format. You need to add a first row that represents time.