How to select specific data from an excel file which consists of more than 1 row and more than 1 column of data
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to programme a way where the user can select a specific data from my excel file. The excel file consists of 13rows and 6 columns with the first collumn and first row as headings. I want to make it so the user selects heading 1 then selects heading 2 and then print out the value that corresponds to the 2 selected headings.
1 Kommentar
dpb
am 1 Dez. 2021
Look at
doc uigetfile
doc sheetnames
doc listdlg
doc readtable
Those and examples given for using them should let you put together a tool pretty quickly...
Antworten (1)
Rishabh Singh
am 7 Dez. 2021
Hi,
Considering the excel data as in below,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/826535/image.png)
table = readtable("Example.xlsx"); % read excel file from the directory
%access the heading
heading1 = table.X1;
heading2 = table.X2;
Hope this helps.
2 Kommentare
dpb
am 10 Dez. 2021
Not without seeing the actual complete code and the error in context -- and attaching the file would never hurt; we can't really guess what the variable names might be...
At a minimum show us what
table = readtable("YourFile.xlsx");
table.Properties.VariableNames
returns.
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!