MATLAB: How to add the results of the checkbox to the table.

callbackcheckboxMATLABmatlab gui

Help me. I have 5 checkboxes, when I click the first checkbox the results will be displayed in the table. the problem is, when I click the second checkbox, the second checkbox results, appear in the table but replace the first result … can anyone help me …
// checkbox1 this is true or false?
a= get(hObject,'Value');
if a==1
set(handles.uitable1,'data',{'Bercak', '1', '0';})
else
set(handles.uitable1, 'data', '');
end

Best Answer

When you set the uitable data, you're setting the entire table, not just one line of the table.
For example, in this line from your code:
set(handles.uitable1,'data',{'Bercak', '1', '0';})
The entire data table will be just that 1 row.
Instead, you need to read each checkbox and write the entire table including all rows. If you need help with that let me know.
Related Question