MATLAB Answers

i'm writing an app to read data from excel file and plot the data with matlab app designer, is there any example i can refer to

178 views (last 30 days)
vijayagopi r
vijayagopi r on 3 Dec 2018
Commented: vijayagopi r on 9 Dec 2018
i need to create a gui where the user can select an excel file with selected path and create plots with with various columns as x and y axes, i also need to provide with an dropdown menu for headings in column, is there any example cases that i can refer to?


Sign in to comment.

Answers (1)

Kojiro Saito
Kojiro Saito on 4 Dec 2018
Edited: Kojiro Saito on 5 Dec 2018
It's not Excel file, but MATLAB document has an Example of uigetfile and dropdown menu.
You can also open this example by the following command.
If you want to specify file extensions with .xlsx and read it as a table, the following will work.
[file, path] = uigetfile('*.xlsx');
t = readtable(fullfile(path, file));
I've attached a sample mlapp file (as a zip file) which sets drop down menu from input Excel file.


vijayagopi r
vijayagopi r on 4 Dec 2018
i need to provide an drop down menu where the user can read and select each column's id (of the excel file)
i want to know how to address the dropdown menu to the data associated with the excel file
Kojiro Saito
Kojiro Saito on 5 Dec 2018
I've updated my previous answer and attached a sample mlapp file.
Drop down menu can be created from input file as the following.
[file, path] = uigetfile('*.xlsx');
if isequal(file,0)
msgbox('Please input an Excel file')
t = readtable(fullfile(path, file));
app.UITable.Data = t;
% Set column names as a pull down menu
app.xDropDown.Items = t.Properties.VariableNames;

Sign in to comment.

Sign in to answer this question.