Reading specific Cell in Excel

161 visualizzazioni (ultimi 30 giorni)
Russell
Russell il 30 Mag 2014
I am trying to read a certain cell in Excel with matlab.(B2)
I am then going to use this in an if statement.
Please advise

Risposte (3)

Mahdi
Mahdi il 30 Mag 2014
Modificato: Mahdi il 30 Mag 2014
Have you looked at the xlsread documentation? It tells you exactly how to do it.
Example:
filename='hello.xls' #Name of file
x=xlsread(filename, 'B2')

Lotus Kannan
Lotus Kannan il 14 Mar 2017
%% x only reads B column values from the excel
filename='example.xlsx';
x = xlsread(filename,'B:B');

Shirin Mozaffari
Shirin Mozaffari il 18 Lug 2018
for example you wanna read cell A2. This is what you should do: cell = xlsread(fileName,'A2:A2')
  2 Commenti
Jesus Leal
Jesus Leal il 13 Mar 2022
what if i wanted to recall a cell and every 6th cell after that
NAFTALI HERSCOVICI
NAFTALI HERSCOVICI il 29 Mag 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")

Accedi per commentare.

Categorie

Scopri di più su Data Import from MATLAB in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by