Reset Button Gui

3 ビュー (過去 30 日間)
Melvin
Melvin 2012 年 3 月 8 日
コメント済み: IKGYEOM KIM 2020 年 4 月 14 日
Hi everyone. What code should I put under a push button if I want to reset the inputs and outputs presented on the GUI to its most initial state? Thank you. :)

回答 (3 件)

Sermed
Sermed 2012 年 3 月 13 日
Hi Melvin The way I do it is: Under the callback function of the reset push button write: set(handles.edit1, 'value', 0)set(handles.edit2, 'string', 'default') ...... this will solve the problem if you have a limited nr of input parameters. Their might be some other smarter methodes :o)
  1 件のコメント
IKGYEOM KIM
IKGYEOM KIM 2020 年 4 月 14 日
thx

サインインしてコメントする。


Aldin
Aldin 2012 年 3 月 13 日
You can try this code: Callback for your RESET BUTTON: set(handles.edit1,'String','') ('' - is empty String)
  2 件のコメント
Matt
Matt 2013 年 5 月 10 日
HI
what about if i want to make the axis empty?
yogesh jain
yogesh jain 2016 年 3 月 8 日
axes(handles.axes1); cla;

サインインしてコメントする。


aveks Gebastyan
aveks Gebastyan 2018 年 8 月 12 日
hi everyone. my question same with @melvin. if we want to reset uitable, what can I do (source code) in callback reset button?... thanks..
  2 件のコメント
Walter Roberson
Walter Roberson 2018 年 8 月 12 日
set(hObject, 'data', [])
aveks Gebastyan
aveks Gebastyan 2018 年 8 月 12 日
thanks for answer...I have problem again, how to reset or remove checklist on the checkbox?. because I use the checkbox for insert data to uitable. so if we reset data in uitable, the cheklist in checkbox must be lost...
function checkbox1_Callback(hObject, eventdata, handles)
% hObject handle to checkbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of checkbox1
set(handles.uitable1,'data',{'Bercak', '1', '0';})
% --- Executes on button press in checkbox2.
function checkbox2_Callback(hObject, eventdata, handles)
data=get(handles.uitable1, 'data');
data(end+1,:)={'numb', '1', '0';}; %if data is a cell or
set(handles.uitable1, 'data', data);
thanks..

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeApp Building についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by