Azzera filtri
Azzera filtri

Matlab Deployment not working

10 visualizzazioni (ultimi 30 giorni)
MikeSv
MikeSv il 14 Ott 2016
Commentato: MikeSv il 15 Ott 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 Commento
Marc Jakobi
Marc Jakobi il 14 Ott 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.

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 14 Ott 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 Commenti
Walter Roberson
Walter Roberson il 14 Ott 2016
Modificato: Walter Roberson il 14 Ott 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 il 15 Ott 2016
Hi. Thanks! I will try this as soon as possible and get back you!
Regards,
Michael

Accedi per commentare.

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by