Re: [問題] 想請教GUI~Callback的問題已回收
※ 引述《gigi731225 (我要更多的nice play)》之銘言:
: 程式如下:
: %---Executes on button press in Close (Tag 為 Close的物件)
: function Close_Callback(hObject, eventdata, handles)
: % hObject handle to Close (see GCBO)
: % eventdata reserved - to be defined in a future version of MATLAB
: % handles structure with handles and user data (see GUIDATA)
: clc % 清除Command Window
: clear % 清除Workspace裡的變數
function 裡的變數空間是獨立的
不然你丟變數進去就沒意義了
w
: 執行之後 Command Window裡的值有被清除
: Workspace裡的變數還是有在
: 程式碼也沒有出現Error
: 但倘若使低階的方式去寫
: 程式如下:
: h1=figure('position',[200 200 400 250])
: close=uicontrol('style','pushbutton','position',[100 50 150 50],...
: 'string','Close','callback','clc;clear')
: 就可以達到我要的目的
: 我覺得用高階應該也要可以,只是忽略了哪個環節
: 因為我剛學GUI,麻煩大家幫忙,謝謝!
: PS:另外想請問用低階的寫可以產生panel這個物件嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.195.58.253
→
10/03 18:54, , 1F
10/03 18:54, 1F
→
10/03 18:55, , 2F
10/03 18:55, 2F
→
10/03 18:55, , 3F
10/03 18:55, 3F
→
10/03 19:30, , 4F
10/03 19:30, 4F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章