Is there an option to disable "startup.m" from being compiled into my code?

조회 수: 13 (최근 30일)
There are "addpath" and "cd" commands in my "startup.m" file. When I compile code for deployment and run the program on the deployed machine, these lines cause errors. However, it works as expected on the development machine.
I do not want the application compiler ("deploytool") or "mcc" to compile "startup.m" into my application, so I would like the option not to have it compiled into the final code if possible.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2022년 7월 26일
편집: MathWorks Support Team 2022년 9월 28일
"startup.m" is compiled into the deployed program to ensure that the deployed application code behaves the same as the code in the MATLAB environment.
There is currently no compiler option to disable this feature. However, the "isdeployed" function can be used as a workaround within the "startup.m" file.
For example:
if ~isdeployed
  % startup code. Including specify 
  % computer specific settings
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Standalone Applications에 대해 자세히 알아보기

제품


릴리스

R2013b

Community Treasure Hunt

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

Start Hunting!

Translated by