properties (Access = private) t % Table to share between callback functions
end % Callbacks that handle component events
methods (Access = private) % Button pushed function: ExcelDataButton
function ExcelDataButtonPushed(app, event) app.t = readtable("Book1.xlsx","Sheet",1); app.UITable.Data = app.t; %t.Properties.VariableNames{1} = 'Parameter';
%t.Properties.VariableNames{2} = 'Values';
%app.UITable.ColumnName = t.Properties.VariableNames;
end % Button pushed function: AddButton
function AddButtonPushed(app, event) Parameter = app.ParameterEditField.Value; Values = app.ValuesEditField; nr = {Parameter Values}; app.UITable.Data = [app.t;nr]; //% Line with error is here
end end
I get an error on the "Line with error is here" that reads:
An error occurred when concatenating the table variable 'Values' using VERTCAT.
Caused by:
Error using matlab.ui.control.NumericEditField/vertcat
Cannot convert double value 1 to a handle
I'm not sure how to solve this yet.
Additionally, I want to find a good way to edit existing data in excel fields.
Best Answer