Why do standalone applications built using "Simulink Compiler" with "boolean" values yield unexpected results in MATLAB R2024b?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 19 Nov. 2024 um 0:00
Beantwortet: MathWorks Support Team
am 25 Nov. 2024 um 18:55
I have an app where I am using a button to switch on a light. I am creating a variable "newVar" based on the status of the button as per the user input.
When I run this app from "App Designer", it works as expected.
When I package the same app and run it as a standalone application, it does not run as expected.
My code for declaring "newVar" is:
function InOneValueChanged(app, event)
value = app.InOne.Value;
newVar = Simulink.Simulation.Variable('andIn1',boolean(value));
simulink.compiler.modifyParameters(app.modelName,newVar);
end
Akzeptierte Antwort
MathWorks Support Team
am 25 Nov. 2024 um 0:00
The issue is in function "InOneValueChanged" due to the usage of boolean. "boolean" is not a deployable function.
The fix is to change boolean to logical which is deployable.
newVar = Simulink.Simulation.Variable('andIn1',logical(value));
The developers are aware of this and will consider adding support for "boolean" in future releases.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Deploy Standalone Applications finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!