MATLAB: How to plot matrix from a text file in App Designer

app designertext file

Hi everyone,
I want to plot the 2nd and 3rd columns of a matrix of [5000×3 double] using Axes from the component library. However, I could not see how to plot the matrix in text file in the uiaxes documentation. How can I do that?
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: Button
function ButtonPushed(app, event)
[file, path] = uigetfile('*.txt');
filename = [path file ];
A=importdata(filename);
end
end

Best Answer

The same way you would plot it in MATLAB. Just be sure to specify the target axes.
plot(app.UIAxes,xData,yData)