我有两个连接到文本路径的单选按钮,因此当我按下任一单选按钮时,我试图清除文本路径。这是我的代码所以:
%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 :(得分:0)
替换
set(handles.file1Path,'',text)
set(handles.file2Path,'',text)
与
set(handles.file1Path,'String','')
set(handles.file2Path,'String','')