Import table from row oriented excel sheet
30 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bruce MacWilliams
el 22 de Mayo de 2019
Comentada: Jerome Baranger
el 22 de Abr. de 2022
I have Excel worksheets oriented such that variable names are in the first column and variables in rows. e.g.:
Var1 1 2 3 ...
Var2 4 5 6 ...
Var3 7 8 9 ...
etc.
This would be "row oriented" data to use the Matlab description of the readtable command which is expecting "column oriented" data. There does not seem to be a way to use readtable to transpose the data so it is read correctly. I can read the array and then transpose the data but there does not seem to be a way to read in variable names from a column with this command/approach. Seems like this should just be a simple orientation option that you can set in the function call or table options. Am I missing something? I looked at a bunch of similar themed questions but did not find a satisfactory answer. My guess is that I have two choices if I wnat to end up with table data:
1) Transpose the data in Excel into a new worksheet and use readtable()
2) Use xlsread() or some other variant to read data and varialbe names into separate arrays, do the transpose on the data and cobble together the table using opts.VariableNames
1 comentario
Bob Thompson
el 22 de Mayo de 2019
Does the option to 'ReadRowNames' not work for your situation? This is for the readtable command.
Respuesta aceptada
Bruce MacWilliams
el 22 de Mayo de 2019
Editada: Bruce MacWilliams
el 23 de Mayo de 2019
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!