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

5 Ansichten (letzte 30 Tage)
bx
bx am 28 Feb. 2024
Beantwortet: Kothuri am 23 Sep. 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 Kommentare
hao jiang
hao jiang am 5 Jul. 2024
How did you solve this error?I encountered the same problem.
bx
bx am 5 Jul. 2024
sorry,it's too long time to i forget it.maybe your folder context have the same name simulink file

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Kothuri
Kothuri am 23 Sep. 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

Kategorien

Mehr zu Deploy Standalone Applications finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by