Is there an option to disable "startup.m" from being compiled into my code?
조회 수: 13 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2022년 6월 21일
편집: MathWorks Support Team
2022년 9월 28일
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
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Standalone Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!