As we saw in Get path from runnig script to obtain in a automated way the path where our MATLAB file was running,
there is a comand for obatin the path of the execution of our MATLAB App?
The aim is used it in the StartupFcn function.
Thank you!

4 件のコメント

Abolfazl Chaman Motlagh
Abolfazl Chaman Motlagh 2021 年 9 月 10 日
if you mean path of location which the app comes up, can't you just use pwd?
i use it before in StartupFcn. and it work correctly even after compile for standalone desktop app.
Josep Llobet
Josep Llobet 2021 年 9 月 10 日
Yes, path location.
And yes, I've just comproved it and it results in the path of the App.
And, what is curious, is that I can define diferent path and describe it in pwd, but when I call an function as imread() to open a image from a folder inside the app folder, it is opened although the pwd has been changed...
imread("Imatges\Inicials\P1011624.JPG");
Josep Llobet
Josep Llobet 2021 年 9 月 10 日
@Abolfazl Chaman Motlagh, if you publish your answer I would be glad to mark it as Correct Answer
Abolfazl Chaman Motlagh
Abolfazl Chaman Motlagh 2021 年 9 月 10 日
glad to help
you can put local direction using pwd in your app.
imread([pwd '\imagesfolder\image.jpg'])

サインインしてコメントする。

 採用された回答

Abolfazl Chaman Motlagh
Abolfazl Chaman Motlagh 2021 年 9 月 10 日

0 投票

if you mean path of location which the app comes up, can't you just use pwd?
i use it before in StartupFcn. and it work correctly even after compile for standalone desktop app.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDebugging and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by