I have an application that works perfectly in MATLAB but when compiled as a standalone application does not...
With a try and catch statement I think I discovered that the problem is the data file... I have a data file called Data.mat, I think that the standalone application is not able to find it. The function I am using to find the path for Data.mat is the following:
function thePath = showpath()
if isdeployed
[status, result] = system('set PATH');
thePath = char(regexpi(result, 'Path=(.*?);', 'tokens', 'once'));
else
thePath=pwd;
end
The main program call this function in this way:
try
imgFile1 = fullfile(showpath, 'Data');
shipp=load(imgFile1);
catch err
if ~exist(imgFile1, 'file');
errordlg('File does not exist','Input Error');
else
rep = getReport(err, 'extended');
msgbox(rep)
end
end
Where is the mistake?