How to automically read data from excel file
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Chao Zhang
am 20 Mai 2021
Beantwortet: Cris LaPierre
am 20 Mai 2021
I am newer to learn Matlab, so I would like to ask for some help.
I use 'menu' function to create 3 buttons, such as 'A', 'B', and 'exit the program', and I want to automically select and read the dataset of different excel files when users click button A or B, and users then can use the dataset in the workspace to do some computations.
For this purpose, i then create function A and function B respectively, the following example is function A:
function A(data, position)
%data.name is the appropriate excel file, pathname is the position of file
%specifies the type of file that can be selected
[data.filename, pathname]=...
uigetfile({'*.xlsx';'*.xls';'*.*'},'File Selector');
pathname=string(pathname);
data.filename=string(data.filename);
if isequal(data.filename,0)||isequal(pathname,0)
return
else
data.fileText.Value=pathname+data.filename;
end
but i have no idea how to read the dataset and use them after i run this code and select the excel file,
so how to accomplish this goal?
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!