Reboot a gui in Matlab

Hi,
anyone knows how to reboot or create a pushbutton to restart a gui?
I've got a program with a button "Restart" and I want that when someone push it, the program starts again.
Thanks!

 Respuesta aceptada

Matt Fig
Matt Fig el 14 de Nov. de 2012

0 votos

Here is a simple example:
function [] = restart_gui()
S.f = figure('menubar','none',...
'numbertitle','off',...
'pos',[300 300 400 100],...
'Name',['Opened at: ',datestr(now,'HH:MM:SS')]);
S.pb = uicontrol('Style','Push',...
'String', 'Restart',...
'Position', [10, 10, 380, 80],...
'Callback', {@pb_cb});
movegui('center')
function [] = pb_cb(varargin)
% Callback for pushbutton.
close(gcbf)
restart_gui % Call the name of the GUI

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 14 de Nov. de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by