How to save .mat files from compiled code (.exe)

조회 수: 10 (최근 30일)
Eathan Baumgartner
Eathan Baumgartner 2018년 8월 6일
댓글: Eathan Baumgartner 2018년 8월 7일
So I have made an application(gui) in matlab and compiled it to an exe. My gui has a save and load button that operate as such. on save callback: save('saveGame.mat','handles');
on load callback: load('SaveGame.mat');
This works when the code is being run from matlab. However, when I run the application from the compiled exe, I get an error sound when clicking save. Does anyone know why this may be?
  댓글 수: 3
Adam
Adam 2018년 8월 7일
If you tell it to create a log when you package your app you will see what the error is, or if you run your exe from command line.
Since you appear not to be giving a path for your save file it will save it in whatever the current directory is. I forget, off-hand, what this is for an executable, but it isn't generally somewhere to be saving user files. It's possible you don't have write permission there too.
Eathan Baumgartner
Eathan Baumgartner 2018년 8월 7일
Thanks, this you were right, it did not have permission to the folder it was trying to save to.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by