I'm building a GUI that shows images when I push a button, but there are a lot of images, and sometimes I want to jump over a number of images, so what I'm trying to do is, get a edit texbox, where I put the number of the image I want to go, push a button to push the other button until i get to the desired image. I want to make this way( pushing the other button x times to get to the desired image) because there are a bunch of parallel stuff happening at the same time the image is passing to the other.
so my code for the button is:
function pushbutton14_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
i = str2double(get(handles.edit4, 'String'));
while handles.counterN < i
pushbutton1_Callback(hObject, eventdata, handles);
guidata(hObject, handles);
end
So every time I push button 14, I want to get it to push the button 1, until the counter(which is added 1n every time button 1 is pushed) gets to the value in edit4.
But for some reason the guidata is not updated, so the counter always stays as 1.
I have guidata(hObject, handles); , in the end of the button 1 function... so I don't understand why is not updated, I also tried without guidata(hObject, handles); in the while loop