I have a figure of table. The user will insert a data into the table. If the user suddenly inserts the wrong data, the table will be 'NaN'. My question is how I want to make the table does not display 'NaN' on the table but I want an error message appear. I have this coding:
function Mytable1_CreateFcn(hObject, eventdata, handles)if isnan(Mytable1) set(hObject, 'Data', 0); errordlg('Input must be a number','Error');endhandles.Mytable2 = hObject;guidata(hObject,handles);
But there is an error with this code. Is this coding are correct to answer my question?
Best Answer