フィルターのクリア

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

1 回表示 (過去 30 日間)
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].

採用された回答

Walter Roberson
Walter Roberson 2013 年 8 月 25 日
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 ?

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by