selecting columns by their name
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I use the attached test.xlsx file as an example to explain my problem. Assume that I have the test.xlsx in excel and I want to use this to do operations on its columns. But this operation just needs to be performed on specific columns. For example I need my code to first select the numerical values in columns that have "AUD AUD_EOD" with "Zero 1d" and "AUD AUD_EOD" with "Zero9m" in their titles to be saved in a matrix A. Then do the same thing for columns with "CAD CAD_EOD" with "Zero 1d" and "CAD CAD_EOD" with "Zero9m" in their titles and save them in matrix B and then do the operation on matrix A and B. So my problems is that, how can I do this selection without using for loops. Again as I said the test.xlxs is just a sample and I basically have a huge file that this needs to be done for it.
I appreciate any comments to solve this problem.
Thanks,
0 comentarios
Respuestas (1)
Image Analyst
el 30 de Abr. de 2016
Editada: Image Analyst
el 30 de Abr. de 2016
It's easy if you use tables. Use readtable() to read in the workbook
t = readtable('test.xlsx', 'Range', 'B4:L9')
oneColumn = t.AUDAUD_EOD % Get just this one column with this name
0 comentarios
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!