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

 Akzeptierte Antwort

Friedrich
Friedrich am 14 Aug. 2012

0 Stimmen

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 Kommentar

Oluwayemi
Oluwayemi am 14 Aug. 2012
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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 12 Aug. 2012

0 Stimmen

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 Kommentar

Oluwayemi
Oluwayemi am 13 Aug. 2012
Thanks for the reply. Even with the change directory command cd, I still encounter the problems I highlighted previously.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB Compiler finden Sie in Hilfe-Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by