Suppose I have a input box that requires an entry greater than zero before attempting to load a file.
function test_Callback(hObject, eventdata, handles) test = str2double(get(hObject, 'String'));if isnan(test) set(hObject, 'String', 0); errordlg('Input must be a number','Error');endhandles.backup.test= test;guidata(hObject,handles)function loaddata_Callback(hObject, eventdata, handles) test_Callback(hObject, eventdata, handles)[filename, pathname, Index] = ... uigetfile({'*.txt';},['Select the File to load'],... '\\MyDocuments\User');
This prompts the error "'Input must be a number','Error'' and allows the user to open and search for this file. What am I doing wrong?
Best Answer