Within a function I've programmatically created an editable uitable with a plot. Whenever the cell values change, the plot updates. I'd like to set the new edited table as the output. My code so far:
function outputTable = begrenzung()
t = table(Drehzahl, Drehmoment, 'RowNames',{'Startpunkt' 'P1' 'P2' 'P3' 'Endpunkt'});
fig = uifigure;
fig.Position(3:4) = [822 360];
uit = uitable(fig,'ColumnEditable',true);
uit.Data = t;
uit.FontSize = 10;
uit.FontWeight = 'bold';
uit.ColumnEditable = true;
uit.Position(3) = 375;
ax = uiaxes(fig);
ax.Position(1) = 415;
ax.YLabel.String = 'Drehmoment [Nm]';
ax.XLabel.String = 'Drehzahl [rpm]';
x = t{:,1};
y = t{:,2};
area(ax,x,y);
ax.XLim = [0 45];
ax.YLim = [0 2000];
ax.Title.String = 'Feld der gefahrenen Punkte';
uit.CellEditCallback = @updatePlot;
function outputTable = updatePlot(src,event)
area(ax,uit.Data{:,1},uit.Data{:,2});
end
end
How can I save the updated uitable after each value-change?