I'm trying to make an editable ui table that outputs a matrix of zero's and one's depending on which checkboxes in the table are checked. This matrix with the edited values should be stored in A, but I cannot figure out why this doesn't happen. This is my code:
function [A] = Gui()fig = uifigure;tdata = table('Size',[8 9],'VariableTypes',{'double','logical','logical','logical','logical','logical','logical','logical','logical'});uit = uitable('Parent',fig,'Data',tdata,'ColumnEditable',true,'ColumnWidth',{2 2 2 2 2 2 2 2 2});btn = uibutton(fig,'ButtonPushedFcn', @(btn,event) StoreTable(uit));btn.Position = [80 80 100 22];btn.Text = 'Store';
and:
function [A] = StoreTable(uit)A = get(uit, 'Data');disp(A);
Thanks in advance,
Bas
Best Answer