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 次查看(过去 30 天)
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 个评论
潇文 药
潇文 药 2022-10-8
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.

请先登录,再进行评论。

回答(1 个)

Smit
Smit 2022-10-12
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.

类别

Help CenterFile Exchange 中查找有关 Application Deployment 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by