Reading specific Cell in Excel
268 views (last 30 days)
Show older comments
Russell on 30 May 2014
Commented: NAFTALI HERSCOVICI on 29 May 2022
I am trying to read a certain cell in Excel with matlab.(B2)
I am then going to use this in an if statement.
Mahdi on 30 May 2014
Edited: Mahdi on 30 May 2014
Have you looked at the xlsread documentation? It tells you exactly how to do it.
filename='hello.xls' #Name of file
Lotus Kannan on 14 Mar 2017
%% x only reads B column values from the excel
x = xlsread(filename,'B:B');
Shirin Mozaffari on 18 Jul 2018
for example you wanna read cell A2. This is what you should do: cell = xlsread(fileName,'A2:A2')
NAFTALI HERSCOVICI on 29 May 2022
Is there any way to use the cell indices rather than letters to specify columns?
Like in excel the range can be defined as Range(cells(2,1),cells(2,1)) instead of Range("a2:a2")
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!