Why do I get an error when trying to run a simulation with a compiled simulink model?

1 ビュー (過去 30 日間)
Pascal Knappe
Pascal Knappe 2017 年 8 月 31 日
コメント済み: Pascal Knappe 2017 年 9 月 7 日
This is the code:
Time = (0:99999)';
InputA = rand(100000,1); InputB = rand(100000,1); InputC = rand(100000,1);
InputD = rand(100000,1); InputE = rand(100000,1); InputF = rand(100000,1);
InputG = rand(100000,1); InputH = rand(100000,1); InputI = rand(100000,1);
InputmatrixDouble = [Time InputA InputB InputC InputD InputE InputF InputG InputH InputI];
save('InputmatrixDouble', 'InputmatrixDouble');
[status, cmdout] = system(['Testcase_double.exe -i InputmatrixDouble.mat -tf ', num2str(Time(end)) ,' -o OutputmatrixDouble.mat'])
All inport data types of the model are set to "double", but I get the following error when trying to run the model:
** Starting model 'Testcase_double' @ Thu Aug 31 09:55:02 2017
Error starting model: Data type of matrix variable from MAT-file InputmatrixDouble.mat can only be double while data type of inport 0 is not set to double.
The error message dosn't change when i set the input data type to "Inherit: Auto"
How can I get the model running?

回答 (1 件)

Ning Zhang
Ning Zhang 2017 年 9 月 6 日
編集済み: Walter Roberson 2017 年 9 月 6 日
  1 件のコメント
Pascal Knappe
Pascal Knappe 2017 年 9 月 7 日
This is one solution that would work, yes. Step 5 of the document shows 3 different formats to save an inputmatrix. I did it like format 1), so it should also work like this?!

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by