필터 지우기
필터 지우기

How Can I create exe file of GUI program (.fig, .m)

조회 수: 2 (최근 30일)
hoda kazemzadeh
hoda kazemzadeh 2018년 6월 15일
댓글: Adam 2018년 6월 19일
Hi I have GUI matlab program (with some functions and csv file inside which I call) and I want to convert to exe. I use 'deploytool' and application compiler to do that. I read some parameters from csv file so if I change csv file, the output must change too. But it seems that it does not depend on csv file and it run with some default parameters from the previous run.
my second question is that if I have to creat exe files for all the functions which I call inside the main code or not? Thanks

답변 (1개)

Adam
Adam 2018년 6월 15일
For the second question, no, you create an exe for your top level function and it will bring in all the dependencies it needs (though you do have to add some yourself sometimes - e.g. if you call functions using str2func or some other method by which a string turns into a function.
The first question is impossible to answer without a lot more information - e.g. does it work fine before it is deployed? Are you using full file paths rather than relative file paths? How are you initialising the GUI, what code are you running when the csv file changes? etc
  댓글 수: 10
hoda kazemzadeh
hoda kazemzadeh 2018년 6월 17일
That is working perfect thanks.
there is one small issue, I use readtable in two different functions; my main function and in another one in which I generate wav files. When I run the exe file at the beginning I have to choose csv file from my desired directory that was my goal but, for the second step when I press storebutton to create wav files, again asks me to choose csv file that is not my issue. for the second one I want to read from a csv file in a specific directory which I saved my csv file already. (for example in the same folder of exe file) Is that possible?
Adam
Adam 2018년 6월 19일
You can save files to wherever you want if you have the file path and the folder in question has write permissions.
doc ctfroot
can be useful if you need to use a relative path in a deployed application, though you should wrap it in an
if isdeployed
block with an else to define your file path for non-deployed code if you don't wish to save relative to where ctfroot points for non-deployed code (which appears to be the Matlab install directory, which is not usually useful as a relative directory for your own files)

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

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by