How to import a column from an Excel file?
Mostrar comentarios más antiguos
This is my excel file:

Here I read the entire column A of the Excel sheet named "Lazy_eight" but the problem is that I have different sheets in which the column A has a different number of elements. So, I want to import only the numbers without specifing the length of the column vector.
I use the function readmatrix with the following syntax in order to read the entire column:
p_time = readmatrix('Input_signals.xlsx','Sheet','Lazy_eight','Range','A:A')
i get this in matlab workspace:

So, I wish to give to the "readmatrix" function only the first element of the column I want to import but I want that it stops at the last element, without specifing the coordinate of the last element in order to avoid the NaN that you can see in the last image. I want to import only the numbers without the NaN value.
I cannot read the initial and the last element (in this way: 'Range', 'A3: A13') beacuse in every sheet the column A (as the other ones) has a different number of elements.
2 comentarios
João Mendes
el 16 de Abr. de 2021
Maybe you can just import the entire matrix and then, in matlab, isolate the first column? Or that is not what you want?
Giuseppe
el 16 de Abr. de 2021
Respuesta aceptada
Más respuestas (1)
Giuseppe
el 17 de Abr. de 2021
0 votos
Categorías
Más información sobre Spreadsheets en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!