Attempted to access x(1,2); index out of bounds because size(x)=[105760,1].

7 ビュー (過去 30 日間)
Manjutha Manavalan
Manjutha Manavalan 2016 年 8 月 31 日
コメント済み: Walter Roberson 2019 年 7 月 3 日
can you please solve this sir
for i=1:2
for j=2:len-1
x(j,i) = (x(j-1,i) + x(j,i) + x(j+1,i))/3 ;
end
end
i am getting error command Attempted to access x(1,2); index out of bounds because size(x)=[105760,1].
Error in highfrequencynoiseremoval (line 14)
x(j,i) = (x(j-1,i) + x(j,i) + x(j+1,i))/3 ;

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 8 月 31 日
From the error message, it appears that your variable x is a a column vector 105760x1 . In your code you are trying to access x(1,2) which should be in the second column that doesn't exist
  3 件のコメント
shivam verma
shivam verma 2019 年 7 月 3 日
how you solve this problem can u tll me please. i m a beginner in the imag processing ..
Walter Roberson
Walter Roberson 2019 年 7 月 3 日
The original poster of the question looks to have created x as a column vector somehow. That could have occurred if they had used (:) or reshape() to force it to be a column vector. It could also have occurred if they were not careful in how they deleted some data from the array. For example if they used
x(1:5) = [];
instead of
x(1:5,:) = [];

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by