Importing data from excel

1 visualización (últimos 30 días)
Can Sever
Can Sever el 9 de Abr. de 2016
Comentada: Kuifeng el 9 de Abr. de 2016
Dear all, I have a problem about importing data from Excel rows. I want to do something like this:
for i=1:10 data(i)=std(A(i):G(i)) end
-So I want to update row number too, since my data set has thousands of observations I cannot do it manually. Is it possible to do this in matlab?
Best regards, Can.

Respuestas (2)

Kuifeng
Kuifeng el 9 de Abr. de 2016
%maybe the function 'size' is what you required.
[rows cols] = size(A);
for i = 1:rows
for j = 1: cols
...
end
end

Can Sever
Can Sever el 9 de Abr. de 2016
Thanks for your answers but I couldnt get it. What I want to do it that:
Instead of using A1:G1 and A2:G2 and so on, is there are way I can write a loop like this:
for i=1:2
do something for A(i):G(i)
end
So my problem is how to update those (i)'s in a loop in order to read data from excel.
Thanks in advance!
  1 comentario
Kuifeng
Kuifeng el 9 de Abr. de 2016
%can you describe the question with an example excel?
%what is A(i):G(i), what is A1:G1? after
data = importdata('abc.xls');
%it already have all rows. no loop is required

Iniciar sesión para comentar.

Categorías

Más información sobre Data Import from MATLAB 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