Simulink does not support loading the input data in file

조회 수: 88 (최근 30일)
Philipp
Philipp 2012년 9월 5일
댓글: bushra sultana 2020년 9월 25일
Hi,
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.
Philipp

채택된 답변

TAB
TAB 2012년 9월 5일
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
clear all;
load('PMAX.mat');
delete('PMAX.mat');
save('PMAX.mat','-v7.3');
Run the simulation again.
  댓글 수: 2
K E
K E 2012년 9월 5일
Very useful!
bushra sultana
bushra sultana 2020년 9월 25일
how can we see the values in mat file on simulink... i used display block but it doesn't show the exact values...instead display the complete values from 0 to 255 for uint8 data type

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Philipp
Philipp 2012년 9월 6일
Perfect, no it works!
Thanks!
  댓글 수: 1
Mohd Noor
Mohd Noor 2015년 11월 6일
An example that works. The file name is "data.mat"
t = [ 1 2 3 4 5 6 7 8 9 10]; v = [1.123 1.125 1.235 1.443 1.135 1.123 1.125 1.235 1.443 1.135]
noor = timeseries(v,t);
save('data.mat','noor', '-v7.3');

댓글을 달려면 로그인하십시오.


Christian
Christian 2015년 12월 3일
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.
Something like
PMAX=double(PMAX);

jessupj
jessupj 2019년 12월 23일
편집: jessupj 2019년 12월 23일
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.

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by