Borrar filtros
Borrar filtros

M and T are 1024*366 matrix want to make a separate matrix that follow some condition?

2 visualizaciones (últimos 30 días)
M and T are 1024*366 matrix want to make a separate matrix that follow some condition
A=[];
nnn=1;
for i=1:1023
nn=1;
for j=1:965
if (T(j,i)>500 && T(j,i)<600)
A(nn,nnn)=M(j,i);
A(nn,nnn+1)=T(j,i);
end
end
nnn=nnn+4;
end
This error How can I solve?
Attempted to access T(1,967); index out of bounds because size(T)=[1024,966].

Respuesta aceptada

Walter Roberson
Walter Roberson el 25 de Ag. de 2013
If M and T are 1024 * 366 then why is your "j" loop running to 965? And since your "i" loop is running to 1023 and it is the first dimension that is as large as 1024, then why are you using "i" to index the second dimension of the matrix instead of the first ?

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing 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