2014-11-16 47 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