Simulink does not support loading the input data in file
80 views (last 30 days)
I have created a matrix called PMAX.mat consisting of samples in the first row and values in the second row.
For example: 1 2 3 4 5 6 7 .... samples 3 2 1 5 6 4 3 .... values
I want to use this matrix for a from file block in my Simulink simulation.
Now I get always the same error message:
Simulink does not support loading the input data in file 'PMAX.mat'. For data saved using MAT file versions prior to 7.3, Simulink can only load two-dimensional arrays consisting of one-dimensional, double, noncomplex samples. To load data of any other type, complexity or dimension, use a timeseries object and save the file using MAT file version 7.3 or later. For example, use: 'save file_name -v7.3 timeseries_object'.
My preferences in Simulink are: 1. Steps from 1 to 525600 2. Fixed step size 1 3. Solver: discrete
Thanks for your help.
TAB on 5 Sep 2012
From File block not supports Version 7.0 or earlier mat-file. Save your create a mat-file with the same date in the Version 7.3.
In the base workspace run below commands
Run the simulation again.
More Answers (3)
Christian on 3 Dec 2015
I had the same problem.
I had simply overlooked, that some of my value types were single.
But as i know know, it can only handle double typ.
So a typecast to double solved my problem in combination with the '-v7.3'-attribute.
jessupj on 23 Dec 2019
Edited: jessupj on 23 Dec 2019
It seems like there is also a problem with broadcasting between column and row vectors even after saving -v7.3 and converting to double.
Simulink can only load two-dimensional arrays or timeseries objects.
The array must consist of one-dimensional, double, noncomplex samples.
Calling X=X(:) before saving worked in my case (r2019a) and didn't require saving to -v7.3 or double conversion.