From: Andy on
"pedro moreno" <pjmf17(a)hotmail.com> wrote in message <i2knsa$ba1$1(a)fred.mathworks.com>...
> Well, actually I don't understand very well the responses... but I still hope that some can give me a solution/idea for my problem... because http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples is a web with advanced code, and my software is easier...

The GUI examples linked to are not complex. Spend some time reading GUI_29, which should be a good start to solving your problem.
From: Walter Roberson on
pedro moreno wrote:
> My code (the wrong solution that I had through), from GUI_1:
> GUI_1:
>
> function pushbutton_Callback(hObject, eventdata, handles)
> gui2; %it returns GUI_2

If gui2 does not return the figure number of the dialog it creates, and gui2
returns before the dialog has been destroyed, then you will need to find the
figure that gui2 creates using findobj() and you will need to waitfor() or
uiwait() for that figure to be closed. Only then can you proceed to test
anything that it created.

> load('acept_cancel.mat');
> if b_Acept
> set(handles.pushbutton2,'BackgroundColor',[0 1 0]); %green colour
> %else, it keeps the default grey colour
> end
>
> GUI_2:
>
> function pushbutton1_Callback(hObject, eventdata, handles)
> %Button ACEPT
> b_Acept= true;
> save('acept_cancel.mat',b_Acept);
> close;
>
> function pushbutton2_Callback(hObject, eventdata, handles)
> %Button CANCEL
> b_Acept= false;
> save('acept_cancel.mat',b_Acept);
> close;
>
> It doesn't work because firstly the file acept_cancel.mat doesnt exist,
> my idea is that it was created only in the execution, and it dissapeared
> at the end. ¿Any idea? thx in advance, and sorry for my voluptuous prose
> again ;)