MATLAB Answers

How to keep data connections when building standalone .exe

3 views (last 30 days)
Vassilis on 30 Sep 2013
Commented: Vassilis on 30 Sep 2013
I have a matlab program that consists of several functions, gui (.fig files) and some .csv files that are used as "databases" for a series of data that are used in the program. I want to compile this program with deploytool in order to make a standalone application, to run in a PC without matlab.
The created application works normally but it doesn't read the data from the database csv files. When I call the deploytool, I instruct it to also include the .csv files in the build. However, the resulting files is only an .exe and when I run it, it doesn't read the data from the csv's in its path rather than displaying the contents of them at the time of its creation.
Is there a way to include these files into the final program, and if they change (by another user/program) the standalone application to actually read them?


Sign in to comment.

Accepted Answer

Matt J
Matt J on 30 Sep 2013
Edited: Matt J on 30 Sep 2013
If the .csv files are going to be changed by other applications, it doesn't seem to make sense to compile them into the standalone. Just distribute the standalone .exe and the .csv's as separate files.

  1 Comment

Vassilis on 30 Sep 2013
You propose, building it again but with the csv files not included in the folder but somewhere else?
edit: Did it and worked! thank you very much!

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 30 Sep 2013
My suspicion is that you have a path problem as to where the csv files are located. See ctfroot() for information on determining which directory the executable was unpacked into.


Sign in to comment.

Community Treasure Hunt

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

Start Hunting!