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

2 Ansichten (letzte 30 Tage)
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?

Antworten (1)

Cris LaPierre
Cris LaPierre am 6 Mai 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?

Kategorien

Mehr zu Search Path finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by