Standalone (compiled) program reading external files
12 次查看(过去 30 天)
显示 更早的评论
Hi,
I currently have a program running in Matlab that uses 'textscan' to read several .csv files located in the same directory as the main program and use the data it obtains from them.
When I export this as a standalone program using the Matlab Compiler I have to include these files within the "shell" of the application. Is there a way getting a compiled program to read files stored within its directory (as the "pre compiled" version did) such that when they are updated with new data the program uses this updated data?
(This is necessary as my end users need access to these csv files but do not have Matlab).
Thanks in advance.
采纳的回答
José-Luis
2014-6-24
Maybe something like this:
filename = fullfile('/path/to/files','MASTER.csv');
fid = fopen(filename)
3 个评论
更多回答(1 个)
Titus Edelhofer
2014-6-24
Hi,
I'm not sure I fully understood the question. If you don't add the MASTER.csv during compilation, and have a call to fopen, then fopen will look in the current folder (which is the folder where the executable is). So if you have in one folder both the .csv and the yourprogram.exe, then everything should be fine ...?
If not, add a line
p = pwd
to find out, "where" you are when running the compiled application.
Titus
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!