Help THANKS! I get the error 'can not resolve the name Simulink.SimulationInput' 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?
回答(1 个)
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”.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!