when i package app and simulink file,why have this error
조회 수: 5 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Kothuri
2024년 9월 23일
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Deploy Standalone Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!