Pergunta

I have a Matlab GUI which takes input in p array from different functions by different methods, my question is how I can terminates uiwait when the input of p array is taken, such that when any function of input is terminated successfully. I'm trying to put uiresume but it doesn't work on my side.

My code (Main Function):

 function varargout = GUI(varargin)
if nargin == 0

    fig = openfig(mfilename,'reuse');
    handles = guihandles(fig);
    guidata(fig, handles);
    uiwait (fig);
    if nargout > 0
        varargout{1} = fig;
    end

elseif ischar(varargin{1}) 

    try
        if (nargout)
            [varargout{1:nargout}] = feval(varargin{:}); 
        else
            feval(varargin{:}); 
        end
    catch
    end

end
Foi útil?

Solução

I don't really get what exactly your code is supposed to do.

In any case: uiresume has to be placed somewhere in a callback of the gui you're opening, since you're above code stops running in the uiwaitline.

So, you might have an "Ok"-Button on your GUI with a callback à la:

function ok_button_callback(object, evt, handles)
    fig = ancestor(object, 'figure');
    uiresume(fig);
end
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top