How to remove a row from a Table in the GUI
6 views (last 30 days)
I try to remove a row from the iutable
I wrote the code to add as following :
% --- Executes on button press in add. function add_Callback(hObject, eventdata, handles) data = get(handles.uitable1, 'data'); data(end+1,:) = 0; set(handles.uitable1, 'data', data)
and from it, i derived the code to remove:
function remove_Callback(hObject, eventdata, handles) data = get(handles.uitable2, 'data'); data(end-1,:)= 0; set(handles.uitable2, 'data', data)
I then get the following error statment:
what I am doing wrong here ?
I initialize the Tables values wih a zero matrix a=zeros(3,4). do I need first to delete the last line of a ?
Thank you Paul
Ingrid on 15 Jun 2015
why did you open a new question? http://nl.mathworks.com/matlabcentral/answers/223133-how-can-i-add-and-remove-a-row-from-a-table-in-the-gui
is not the same as
only the latter removes the penultimate line to make it a 2x4 matrix, the first statement will put it to zero which will not show since all your values are zero in this case
and as Henric said, uitable2 does not exist, you need to use the handle to uitable1