Borrar filtros
Borrar filtros

Assigning excel data to an array via a counter

1 visualización (últimos 30 días)
bugatti79
bugatti79 el 22 de Jul. de 2014
Editada: Azzi Abdelmalek el 22 de Jul. de 2014
Folks,
Here is the code i use to assign data from the 2nd and 6th column in a spreadsheet to an array
for i=1:1:2
t(i)= data(:,5*(i-1)+1); %Time
end
However, i get the following
??? In an assignment A(I) = B, the number of elements in B and I must be the same.
I want to have an array of 2 columns to do further calcs
Thanks
What is wrong? Thanks

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 22 de Jul. de 2014
Editada: Azzi Abdelmalek el 22 de Jul. de 2014
t=zeros(size(data,1),2)
for i=1:1:2
t(:,i)= data(:,5*(i-1)+1); %Time
end

Más respuestas (0)

Categorías

Más información sobre Get Started with 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