Reboot a gui in Matlab

조회 수: 15 (최근 30일)
Staz
Staz 2012년 11월 14일
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!

채택된 답변

Matt Fig
Matt Fig 2012년 11월 14일
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
  댓글 수: 1
Staz
Staz 2012년 11월 14일
Solved! Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by