MATLAB: Save output variables from uitable in the workspace

calleditcallbackguir2048uitable

Hi there,
I am facing some troubles when trying to save the updated values of my editable table into the workspace. The table is automatically updated and changes are saved in "ans". Here the script:
f = figure(1);
d = zeros(1, 7);
t = uitable(f,'Data',d,'ColumnWidth',{50},…
'ColumnEditable', [true true true true true true true]);
% GET DATA whenever the data change
set(t,'CellEditCallback','get(t,''Data'')');
So I would like to have a "real" variable which does the same as "ans". Is this possible?
Thanks in advance.

Best Answer

Hi Joseba,
To save the updated values of the editable table into the workspace in the newData variable, use the below command.
set(t,'CellEditCallback','newData = get(t,''Data'')');