Index exceeds the number of array elements.

2 ビュー (過去 30 日間)
Heya :)
Heya :) 2020 年 9 月 24 日
回答済み: Animesh 2023 年 3 月 6 日
I am trying to solve this problem
***Facing these issues***
  1. (Index exceeds the number of array elements (1).
Error in Untitled_new (line 152)
Error_x(count)=Error_x(count)+(x(i)-x_rec(i))^2;)
2. Also someone can please elaborate how to take real and reconstructed sequence as shown in MATLAB
  2 件のコメント
KSSV
KSSV 2020 年 9 月 24 日
編集済み: per isakson 2020 年 9 月 24 日
This error is striaght forward.When you try to extract more number of elements then present in the array you will get this error.
A = rand(1,10) ;
A(3) % no error
A(10) % no error
A(11) % error, becuase there are only 10 elements and 11th eleemnt is not present.
Heya :)
Heya :) 2020 年 9 月 29 日
thanks

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

回答 (1 件)

Animesh
Animesh 2023 年 3 月 6 日
Hello,
According to my understanding you are trying to access an element outside the size of an array.
For example-
arr = 1:10; % it will create the array of 10 numbers
In the array created above, arr(1) to arr(10) will not produce any error but accessing arr(11) and beyond will produce the above-mentioned error.

カテゴリ

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