MATLAB: Piloting graph in app designer

matlab app designer

Hello friends.
I am trying to create an app in Matlab app designer to plot data from tables.
I want the app to sum the second and third columns then plot the sum of these columns various the first column in the table.
i am facing proplem "Unrecognized method, property, or field 'Var1' for class 'matlab.ui.control.Table'" when i am trying to plot variables i hope you could help me with this problem.

Best Answer

Ok, app.BS is a uitable. app.BS.Data is the information displayed in that uitable.
What I would do, then, is create a property in the app to hold the raw data loaded from BS.txt.
properties (Access = private)
data % raw data from text file
I would add a new variable summing Var2 and Var3 to it (I called it Then I would plot Var1 vs this new variable.
% Button pushed function: ChooseButton
function ChooseButtonPushed(app, event)
[filename, pathname] = uigetfile({'*.txt'}, 'File Selector'); = readtable (fullfile(pathname, filename), 'HeaderLines', 0);
app.BS.Data =;
app.BSEditField.Value = filename;
% Button pushed function: DisplayButton
function DisplayButtonPushed(app, event) =;
plot(app.UIAxes, app.BS.Data.Var1,