My code works when i open the main file directly, but dont work when i open the file from matlab!

2 visualizaciones (últimos 30 días)
Hey!
I'm having a problem with a code in matlab and I don't know what to do.
When I open my .mat file directly (by double-clicking) I can run it normally. When I open matlab and go to your directory it doesn't work.
The code in question calls a program in JAVA. This program has several dependency files that are located in the same directory as your .jar.
As I understand it, when I open matlab and then run the script through the directory, for some reason, .jar does not have access to its dependencies, even though those dependencies are inside the path when I check with "exist ('filename') ".
What do you think it can be?

Respuestas (1)

Cris LaPierre
Cris LaPierre el 6 de Mayo de 2021
Perhaps you need to change the extension of your file? In MATLAB, .mat files are not executable scripts. They are binary files that save workspace variables. Perhaps you meant to create a script, which has a .m extension?

Categorías

Más información sobre Search Path en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by