2014-11-16 191 views
0

我有兩個連接到文本路徑的單選按鈕,所以我試圖讓我在打單選按鈕時清除文本路徑。這是我的代碼,以便爲:MatLab單選按鈕功能

%initialise the radio button 
set(handles.nefFile,'Value',1) 
set(handles.tiffFile,'Value',0) 

% --- Executes on radio button press in .NEF. 
function nefFile_Callback(hObject, eventdata, handles) 
    if get(handles.hObject,'Value') 
     set(handles.file1Path,'',text) 
     set(handles.file2Path,'',text) 
    else 
     set(handles.file1Path,'String',text) 
     set(handles.file2Path,'String',text) 
    end 
guidata(hObject,handles); 

% --- Executes on radio button press in .TIFF. 
function tiffFile_Callback(hObject, eventdata, handles) 

end 
+0

你的問題是....? – ThP

+0

我的問題是當我點擊任一個單選按鈕時,文本路徑不會被清除 – CLearner

回答

0

更換

set(handles.file1Path,'',text) 
set(handles.file2Path,'',text) 

set(handles.file1Path,'String','') 
set(handles.file2Path,'String','') 
+0

什麼是'String'在那裏做什麼? – CLearner