when i package app and simulink file,why have this error

5 visualizaciones (últimos 30 días)
bx
bx el 28 de Feb. de 2024
Respondida: Kothuri el 23 de Sept. de 2024
function startupFcn(app)
start_simulink
end
% Button pushed function: Button
function ButtonPushed(app, event)
%创建模型输入
simInp = Simulink.SimulationInput('untitled');
simInp = simInp.setVariable('a',app.EditField.Value);
simInp = simulink.compiler.configureForDeployment(simInp);
%执行并取出结果
simOut = sim(simInp);
b=simOut.b;
app.EditField_2.Value=b;
end
this is my code in app,and the package error is
Preparing Runtime...
mcc -o app1 -W 'WinMain:app1,version=1.0' -T link:exe -d C:\Users\admin\Desktop\322\new\app1\for_testing -v C:\Users\admin\Desktop\322\new\app1.mlapp -a C:\Users\admin\Desktop\322\new\test.m -a C:\Users\admin\Desktop\322\new\untitled.slx -r D:\matlab2023\toolbox\compiler\packagingResources\default_icon.ico
Compiler version: 8.6 (R2023a)
Analyzing file dependencies.
Unable to build Simulink Rapid Accelerator target.
mcc failure
  3 comentarios
hao jiang
hao jiang el 5 de Jul. de 2024
How did you solve this error?I encountered the same problem.
bx
bx el 5 de Jul. de 2024
sorry,it's too long time to i forget it.maybe your folder context have the same name simulink file

Iniciar sesión para comentar.

Respuestas (1)

Kothuri
Kothuri el 23 de Sept. de 2024
Hi Bx,
I understand that you are facing error when trying to package app and Simulink file.
The error message indicates that there is a problem with building the Simulink Rapid Accelerator target while attempting to package your MATLAB application using the MATLAB Compiler. And suggests that there's an issue with building the compiled version of your Simulink model (untitled.slx).
You can try the below steps to rectify the error:
  • Ensure that the Simulink model is set to use a fixed-step solver as Rapid Accelerator mode requires this configuration.
  • Check for any blocks or features in the model that are not supported by Rapid Accelerator mode and modify these blocks if necessary.
  • Make sure that all variables used in the Simulink model are defined in the base workspace, data dictionary, or model workspace. Even though variables are specified in the SimulationInput object, they need to be available during the Rapid Accelerator build.
  • Try running the Simulink model in Rapid Accelerator mode independently to ensure it works without errors before packaging.
You can refer the below links for more info

Categorías

Más información sobre Deploy Standalone Applications en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by