Borrar filtros
Borrar filtros

Matlab Deployment not working

12 visualizaciones (últimos 30 días)
MikeSv
MikeSv el 14 de Oct. de 2016
Comentada: MikeSv el 15 de Oct. de 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 comentario
Marc Jakobi
Marc Jakobi el 14 de Oct. de 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.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 14 de Oct. de 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 comentarios
Walter Roberson
Walter Roberson el 14 de Oct. de 2016
Editada: Walter Roberson el 14 de Oct. de 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 el 15 de Oct. de 2016
Hi. Thanks! I will try this as soon as possible and get back you!
Regards,
Michael

Iniciar sesión para comentar.

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by