Xlsread command in Matlab

1 visualización (últimos 30 días)
Francesco
Francesco el 11 de Feb. de 2014
Comentada: Francesco el 21 de Feb. de 2014
How Can I extract each columns with the xlsread command.
for i1 = 2:n1+1
matrix = xlsread();
end

Respuesta aceptada

Mischa Kim
Mischa Kim el 21 de Feb. de 2014
Editada: Mischa Kim el 21 de Feb. de 2014
Francesco, with xlsread you read the entire spreadsheet. Which means, that you can read an entire matrix as is, at once. E.g., from the MathWorks documentation:
values = {1, 2, 3; 4, 5, 6; 7, 8, 9}; % write matrix to .xlsx file
headers = {'First','Second','Third'};
xlswrite('myExample.xlsx', [headers; values]);
and then
filename = 'myExample.xlsx'; % read matrix from file
A = xlsread(filename)
1 2 3
4 5 6
7 8 9
as expected, A is read as a 3-by-3 matrix.
  2 comentarios
Francesco
Francesco el 21 de Feb. de 2014
Kim, this question is not very important. It's a old matter. But I am happy that you reply me! Thanks!
Francesco
Francesco el 21 de Feb. de 2014
I would like to say you if it's very difficult to reply at this questions? Can I hear you opinion?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by