I’m building a GUI that running few tests.
There is data in a mat file that need to be uploading every time the user runs a specific test.
The only way I found to load the data is to read this file,
Data = load(Theoretical_Si.mat)
The problem is that once compiling the GUI to exe, one must remember to place the mat file into the x32\x64 folder, this is a risk that for time to time disruptive the work.
Is there any “elegant” way to load the data without read the file? Can I somehow put the data into the GUI?

 채택된 답변

Image Analyst
Image Analyst 2014년 1월 1일

0 개 추천

Alternatively, if you're using GUIDE, yes you can put the data into the GUI. If the data are settings for various controls on the GUI, then you can set their values in GUIDE and they will be those values when it launches.

댓글 수: 4

Likhit
Likhit 2017년 4월 9일
I have a similar problem. My GUI needs a data which I load from a separate file. But I would like to be able to use this GUI on computers without the data files. How do I implement this in GUIDE?
Walter Roberson
Walter Roberson 2017년 4월 9일
If the file does exist on the target computer, then where would it be? Is it going to be in a particular sub-directory of the user's home directory? Is there going to be an environment variable that indicates where it is? Is it going to be in a fixed location (possibly requiring that users create a disk drive just to hold the one set of files) ? Should it be in some directory relative to the one the user was in when they started executing the GUI?
Are you generating an executable using MATLAB Compiler?
Is the idea that the user might have their own custom version of the file that should be used, but otherwise your original versions of the file should be used?
Likhit
Likhit 2017년 4월 9일
I haven't yet created the executable--but I'm planning on it. I'd like others to run the executable using the data from the original files-- but without needing the original files themselves. Is this possible?
Walter Roberson
Walter Roberson 2017년 4월 9일
You can use the mcc option "-a" to add a file to the ones bundled with the .exe . Expect the file to show up in cftroot()
If you are using deploytool you can "add to project"

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2014년 1월 1일

0 개 추천

You can use the mcc option "-a" to add a file to the ones bundled with the .exe . Expect the file to show up in cftroot()

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

태그

질문:

2014년 1월 1일

댓글:

2017년 4월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by