フィルターのクリア

why i cant save files in my standalone app

7 ビュー (過去 30 日間)
Ibrahim Essam
Ibrahim Essam 2017 年 5 月 18 日
コメント済み: Adam 2017 年 5 月 19 日
Hello
when i try to save polygon.mat through my standalone app like this
save([ctfroot,'\output\polygon'],'points');
i get this error
Error using save Cannot create 'polygon.mat' because 'C:\Users\PC~1\AppData\Local\Temp\PC\mcrCache9.2\app5\output' does not exist. Error in app_new/pb_save_polygon_points (line 4131) Error in appdesigner.internal.service.AppManagementService/tryCallback (line 191) Error in matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event)
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 310) Error while evaluating Button PrivateButtonPushedFcn.
so i tried to make dir called output like this
mkdir('output')
it created the dir in the program installation folder not in this mcrCache9.2\app5\output' folder
so i want to know how to do this im really confused thanks in advance

回答 (2 件)

Adam
Adam 2017 年 5 月 18 日
doc mkdir
takes arguments that allow you to specify the parent folder. Never just call it with the name of the folder you want to create unless you are working in some temporary quick script and are happy for it to just create it in your working directory.
Usually, even if you do want to create it in the current directory it is good practice to include a full path.

Jan
Jan 2017 年 5 月 18 日
mkdir(fullfile(ctfroot, '\output'));
save(fullfile(ctfroot, '\output\polygon'));
I would not write to the installation folder. What about using the user folder or the standard documents folder?
  3 件のコメント
Ibrahim Essam
Ibrahim Essam 2017 年 5 月 19 日
the problem now when i create a file using this method after many seconds it's deleted and i have to save this files till the end of my program to visualize this data
Adam
Adam 2017 年 5 月 19 日
You must have code that deletes the file in that case. Or something on your computer nothing to do with Matlab that is deleting files for you in that location.

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

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by