Help THANKS! I get the error 'can not resolve the name Simulink.S​imulationI​nput' while I'm sure that my simulation model is on the same path with deployedScript.m

12 views (last 30 days)
I'm trying to Create and Deploy a Script with Simulink Compiler , here's my code :
function deployedScirpt()
in = Simulink.SimulationInput('PDPG_matlab_app');
in = in.setVariable('Input_Temp',25,'Workspace', 'PDPG_matlab_app');
in = in.setVariable('Intput_Pressure',10,'Workspace', 'PDPG_matlab_app');
in = in.setVariable('Output_Pressure',1,'Workspace', 'PDPG_matlab_app');
in = in.setVariable('Mass_volume',5,'Workspace', 'PDPG_matlab_app');
in = simulink.compiler.configureForDeployment(in);
out = sim(in);
end
After i run the code mcc -m deployedScript.m
i got some warnings:
WARNING: Compilation of Simulink features requires Simulink Compiler.
> position:matlab.depfun.internal/Completion/requiredComponents (line 391 )
position: matlab.depfun.internal/Completion/requiredProducts (line 583 )
position: matlab.depfun.internal/Completion/requirements (line 2924 )
position: matlab.depfun.internal.requirements (line 198 )
position: matlab.depfun.internal.mcc_call_requirements (line 48 )
and deployedScript.exe are created on the path
and when i try to run the code system('deployedScript.exe')
here's error: can not resolve the name Simulink.SimulationInput. I read frome the help txt that this error occurs when the model is not on the path. but i‘m sure that they are all on the same path.
Can you help me? How can i run the .exe file correctly?
  3 Comments
潇文 药
潇文 药 on 8 Oct 2022
Thank you for helping me Benjamin ! Here's my model in the attachment, although i think there's no such other files or models needed in this model. It's mot complicated.

Sign in to comment.

Answers (1)

Smit
Smit on 12 Oct 2022
Hi
The warning “WARNING: Compilation of Simulink features requires Simulink Compiler” suggests that Simulink Compiler might not be installed. I tried to reproduce the error on my end using the model file and code you provided, and the deployed script was running without any errors.
Please ensure that the Simulink Compiler has been installed on your system. You can install it by going to “Add-Ons” and searching for “Simulink Compiler”.
You can find detailed steps to install Add-Ons here.

Categories

Find more on Application Deployment in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!