Borrar filtros
Borrar filtros

Extracting data from excel

2 visualizaciones (últimos 30 días)
Salaijobhaka
Salaijobhaka el 17 de Abr. de 2017
Respondida: dpb el 17 de Abr. de 2017
Hi I would like to extract data from a column in which the second row contains string "P5" (Figure attached). One way is to use "xlsread('filepath/data.csv','DQ:DQ')". In this case one need to look at corresponding excel column index, i.e., "DQ". Is there a way in which one can extract data without looking at excel column index but using the string index, i.e., "P4" instead ?

Respuestas (1)

dpb
dpb el 17 de Abr. de 2017
With "pure" Matlab-supplied functions, no. You would have to do it indirectly, reading the header row then finding the desired string location therein. As xlsread is quite slow already, almost surely at least as fast to simply just read the full sheet and save what you're interested in.
I'm sure it's also possible with COM to write specific commands but that becomes an Excel VBA syntax problem, not Matlab once the automation server is created.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by