How to deploy package that calls an external .m file

I have a series of files: fixed1.m, fixed2.m, fixed3.m, etc; Some of these files call another file named changeable.m; I would like to have the changeable.m file available for the user to modify; the other fixed1.m, fixed2.m, etc files would be hidden in as a matlab application So I deploy the fixed1.m, fixed2.m, fixed3.m, etc files using the matlab deploytool to get a fixed.exe, but I make sure not to include the changeable.m file since I want the user to be able to modify this file. However, I find that the deployed package fixed.exe fails to read the user supplied changeable.m; (If a sample changeable.m was in the directory during deployment, the deploy tool automatic combines this changeable.m to the package fixed.exe and thus fails to read the user supplied changeable.m file If a sample changeable.m was not in the directory during the deployment, the deploy tool still successful deploys the other files to fixed.exe, but still cannot read the user supplied changeable.m) Is there a way to go about enabling a deployed .exe to read a .m file? Thanks

 채택된 답변

Friedrich
Friedrich 2012년 8월 14일

0 개 추천

This wont work at all. MATLAB Compiler generated exe's can't read/use plain m files.
The only way to have interchangeable data is through a file, e.g. mat file.
And please don't cd in your code (or do any other path modifying things), this will most likely break the search path of the MCR.

댓글 수: 1

Thanks Friedrich. Sad to know it is not possible for Matlab Compiler generated .exe to use plain .m files
I will have to modify my code then.
Regards

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 8월 12일

0 개 추천

Are you cd'ing to the user directory? Recall that when you start the .exe (especially by double-clicking on it) the startup directory is not the current directory.

댓글 수: 1

Thanks for the reply. Even with the change directory command cd, I still encounter the problems I highlighted previously.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

질문:

2012년 8월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by