I am trying to work a simple arithmetic problem inside a cell array. I want to add all the rows from one column with all the rows from other column. I am doing this task with a push button with this code under it`s callback function:
function addCol_Callback(hObject, eventdata, handles)
data = str2double(get(handles.uitable1,'data'));
data(:,5) = data(:,3) + data(:,4);
set(handles.uitable1,'data',data);
I am able to get the arithmethic, but all the cells show the NaN message, even those where I had previously entered a number, or chosen a value from a choice list. Is there a way to get rid of the effects that the NaN cause in all the cells?
Here I present an Image before pressing the event button and an image after the button pressed.