I have a Matlab application that has GUI in it. I am now trying to automate some operations and i need to call a function right after the GUI loads without any human in the loop. (Basically simulating human button clicks...)
I have tried calling the wanted function from "_OpeningFcn" and from "_OutputFcn" with no success.
I also tried to follow this link, yet it doesn't work as well :( http://www.mathworks.com/matlabcentral/answers/161545-call-callback-without-mmouse
Any other ideas to how i can invoke a function programmaticly after GUI is fully loaded?
THanks!
Edit1: AS i understood, if i want to call the function then i should bot it in "EnergyData_OutputFcn". so, here is what it looks like:
function varargout = EnergyData_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
hGuiFig = findobj('Tag','btnReportGeneration');
EnergyData('btnReportGeneration_Callback',handles.btnReportGeneration,[],handles);
varargout{1} = handles.output;
the thing is that this function is called recursively (i can see it when debugging) and i eventually get this error message:
Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N)
to change the limit. Be aware that exceeding your available stack space
can
crash MATLAB and/or your computer.
Error in genvarname>isCellString
That brings me to the question that assuming the method described in the post i attached in link above is the correct way, Where do i place this code? (I couldn't even find it in the example files he attached to the post...)
THANKS FOR THE HELP!