フィルターのクリア

Indexing Exceeds number of array elements

2 ビュー (過去 30 日間)
Muhammad Amir Javed
Muhammad Amir Javed 2023 年 2 月 28 日
回答済み: Image Analyst 2023 年 2 月 28 日
et=4; dn1=1:61;
for ii=length(dn1)
r(ii)=(et+((dn1(ii+1)-dn1(ii))))./((dn1(ii)-(dn1(ii-1)))+et);
end
Index exceeds the number of array elements. Index must not exceed 61.

採用された回答

Image Analyst
Image Analyst 2023 年 2 月 28 日
Look at your indexes - they go from ii-1 to ii+1 so ii can only go from 2 to length(dn)-1
et=4;
dn1=1:61;
for ii = 2 : length(dn1)-1
r(ii) = (et+((dn1(ii+1)-dn1(ii))))./((dn1(ii)-(dn1(ii-1)))+et);
end

その他の回答 (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