How can I construct a dataset array from data on an excel worksheet with an unknown number of rows
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I would like to construct a dataset array from data on an Excel worksheet. I know the location of the upper left corner of the data and the number of columns, but not the number of rows. So I can't use for example ds = dataset('XLSFile','Sheet','mysheet',Range,'G8:H25') because I don't know where the lower right hand corner is. I do know that the sheet is blank below the last row of data of interest and also blank to the right of the last column of data of interest, with no entirely blank columns or rows in between. So it would be nice if I could just specify the range using the upper left corner, e.g. 'G8', but this is not accepted by the dataset constructor. I would appreciate any solutions that you may suggest.
0 comentarios
Respuesta aceptada
Peter Perkins
el 5 de Abr. de 2013
Jonathan, it's possible to use named ranges per the XLSREAD reference page, but that may not solve your problem. I don't know of a way to specify a range like b5: without a lower right corner.
Hope this helps.
Más respuestas (1)
Kye Taylor
el 4 de Abr. de 2013
Just try
d = dataset('XLSFile',yourFileName,'Sheet','mysheet')
3 comentarios
Kye Taylor
el 4 de Abr. de 2013
Editada: Kye Taylor
el 4 de Abr. de 2013
Then try
d = dataset('XLSFile',yourFileName,'Sheet','mysheet','ReadVarNames',false)
Can you be more specific about where the data starts in the sheet?
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!