Filter löschen
Filter löschen

Executable build with Matlab Application Compiler returns error: Undefined variable "Simulink" or class "Simulink.Parameter"

6 Ansichten (letzte 30 Tage)
Hello together,
I'm building a Standalone Application with the Matlab Application Compiler based on matlab scripts. In one matlab script a parameter is set as a Simunlink.Parameter object like this:
function SetSimulinkParameter(name, value)
tmp = Simulink.Parameter;
if isnumeric (value)
tmp.Value = value;
tmp.DataType = 'double';
tmp.DocUnits = '';
tmp.Description = '';
tmp.Min = -1e10;
tmp.Max = 1e10;
tmp.CoderInfo.StorageClass = 'Model default';
assignin('base',name,tmp);
end
When running the Standalone application, the following error pops up: Undefined variable "Simulink" or class "Simulink.Parameter". The error points to the second line:
tmp = Simulink.Parameter;
When running the matlab script in Matlab, the scripts works fine.
How can I build a Standalone Application, that sets and reads Simulink.Parameter objects?
  3 Kommentare
Stefan Wahlig
Stefan Wahlig am 15 Sep. 2022
We think, that this error appears, because the Matlab compiler cannot compile Simulink functions. Therefore the Simulink compiler is needed.
However the Matlab Application Compiler uses the mcc - Matlab compiler and not the Simulink Compiler. We will replace the Simulink.Parameter object by a struct.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Rishav
Rishav am 12 Sep. 2023
Hi Stefan,
It appears that your question aligns with a solution already discussed within our community.
To address this issue, kindly refer to the MATLAB answer response provided below:
Thank you,
Rishav Saha

Kategorien

Mehr zu Application Deployment finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by