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

2 ビュー (過去 30 日間)
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?

回答 (1 件)

Cris LaPierre
Cris LaPierre 2021 年 5 月 6 日
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?

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by