MATLAB Answers

uigetfile and fprintf in a MCR-compiled executable

3 views (last 30 days)
Mingyao on 8 May 2013
I compiled a program using MCR and encountered problems related to two functions 'uigetfile' and 'fprintf'.
'uigetfile' was used to locate a file later to be read by the program. In the MATLAB code both the file name and the file path were returned by 'uigetfile', the latter then added to the search path using 'addpath' to facilitate searching and reading of the file. When executing the compiled program, I received a prompt window to locate the file of interest. However, after selecting the file, the rest of the program was not carried out unless the file was located in the same folder as that of the program itself. That is to say, the execution of the program was not successful if the file to be read was located in a folder other than that of the program.
I included 'fprintf' in the original MATLAB code to mark the progress of its execution by displaying various messages in the command window. However, none of the messages was shown when the compiled program was executed.
Any comments regarding how to address these two problems would be greatly appreciated. Thank you.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by