Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Index exceeds matrix dimensions.

1 回表示 (過去 30 日間)
div
div 2018 年 6 月 20 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
if(X(n,5)==X(i(c),5));
  12 件のコメント
div
div 2018 年 6 月 20 日
編集済み: Torsten 2018 年 6 月 20 日
for f=1:m
for i=1:m
for j=1:4
di=abs(X(f,j)-X(i,j));
Z(i)=di;
end
[B,I]=sort(Z);
for c=1:20
if(X(f,5)==X(I(c),5))
k=0
end
end
end
end
Jan
Jan 2018 年 6 月 20 日
What does "X is a file" mean? The name of the file?
In the body of the question, there is a lower-case "i", but in the code in the comment an upper-case "I".
Does the code in the comment solve your question?
In
for j=1:4
di=abs(X(f,j)-X(i,j));
Z(i)=di;
end
You overwrite the value of Z(i) 3 times. Afterwards Z(i) contains only the value for j=4.

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by