Filter löschen
Filter löschen

Matlab Deployment not working

10 Ansichten (letzte 30 Tage)
MikeSv
MikeSv am 14 Okt. 2016
Kommentiert: MikeSv am 15 Okt. 2016
Hello everyone.
I tried to deploy a Matlab .m file with the deploy tool, but I get some strange errors. The program just opens a Dialog which prompts the user to choose some .lvm files. After that the files are read and some graphs are plotted. The main .m file uses one function from an external file. When I try to install the App I get: "Internal error.Failed to initialize application installer (204)"
If I open the "for_testing" version the program starts I chose some files, but when the function is called I just get: "Invalid file identifier. use fopen to generate a valid file identifier. Error in --> ....m at line 15" (The function uses fopen)
Has anyone ever run into the same issue?
Thanks in advance,
Michael
  1 Kommentar
Marc Jakobi
Marc Jakobi am 14 Okt. 2016
Does it run in Matlab (without deploying it)? Do you have some code you can post? When the error message comes up, you can click on the link to "line 15" and see the code where the error occurs.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 14 Okt. 2016
Invalid file identifier in deployed programs is usually related to not being in the directory you think you are. In deployed programs, fopen() of non-absolute paths checks first in ctfroot() and only then proceeds along the usual MATLAB path (so a file in ctfroot overrides a file of the name in the current directory because the current directory is merely the first entry on the MATLAB path). The directory the executable starts in will typically be ctfroot() and will almost certainly not be the user's "current" directory if they started the program by double-clicking on it.
  3 Kommentare
Walter Roberson
Walter Roberson am 14 Okt. 2016
Bearbeitet: Walter Roberson am 14 Okt. 2016
It means that you should make extensive use of fullfile() so that you know exactly where every image is coming from. Use a relative path (no directory) only for image files that you have instructed MATLAB Compiler to add to the project.
If you need to figure out the user's home directory, then you will nee to look at the Environment Variables by using getenv() . See http://windowsitpro.com/systems-management/what-environment-variables-are-available-windows such as for HOMEDRIVE and HOMEPATH
MikeSv
MikeSv am 15 Okt. 2016
Hi. Thanks! I will try this as soon as possible and get back you!
Regards,
Michael

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by