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

조회 수: 13 (최근 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