I got 2 functions in my matlab script. These functions exchange the data via a *.mat
file.
In one of the functions, I read the number of specific files and a data from them. Later I process and store the variable ggd
in proj1.mat
file. As shown below :
function browse_pushBtn_Callback(hObject, eventdata, handles)
% hObject handle to browse_pushBtn (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles.directory = uigetdir('C:\temp\');
guidata(hObject,handles);
ggd.directory = handles.directory;
if (ggd.directory)
set(handles.browse_textEdit,'String',handles.directory);
disp2listbox(handles.mainLog_listBox, '1. Searching for GGD Datafile:');
ggd = MyRead(ggd);
disp2listbox(handles.mainLog_listBox, sprintf(' -%d Bilder
gefunden',length(ggd.bilds)));
save proj1 ggd;
else
set(handles.browse_textEdit,'String','Select a directory');
end
The Second function is :
function start_pushBtn_Callback(hObject, eventdata, handles)
% hObject handle to start_pushBtn (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
option = get(handles.mainMenu,'Value');
if (option == 1)
disp2listbox(handles.mainLog_listBox, '2. Calculating the quadratic size..');
fprintf('path is : %s\n', pwd); % did just to check the path (for debugging purpose)
load proj1 ggd;
ggd = MyProcess(ggd);
save proj1 ggd;
disp2listbox(handles.mainLog_listBox, sprintf(' -MySize: %d X %d',ggd.X(1), ggd.Y(2)));
disp2listbox(handles.mainLog_listBox, '3. opening another function...');
% call to another function
elseif (option == 2)
disp2listbox(handles.mainLog_listBox, '2. opening third function...');
% call to third different function
end
The funny thing is that these two functions work perfectly fine when I run them in Matlab tool.
Later, I compile the standalone executable for my application. This standalone application works fine until the first function; but, when I call the second function, it loads the proj1.mat
file from another unknown location that contains totally different data.
Have no idea what is the problem that causing such weird behaviour.
I checked the current paths (pwd
) in second function while executing standalone
and found it to be the same as the one in first function.
Any ideas ??