"Index exceeds the number of array elements (217)"

2 ビュー (過去 30 日間)
Khayroon Suleyman
Khayroon Suleyman 2019 年 12 月 10 日
コメント済み: Khayroon Suleyman 2019 年 12 月 10 日
Why does MATLAB show me the following error?
"Index exceeds the number of array elements (217)"
I am trying to find the mean for different rows in 1 column and I have 217 rows. I used the following code:
mean(RT([8 12 25 28 30 39 40 48 52 56 58 59 60 63 70 72 97 100 101 102 105 122 123 478 131 132 143 150 164 181 186 191 198 199 211:217,1]))
Why isn't it letting me carry out this function?

採用された回答

Jeremy
Jeremy 2019 年 12 月 10 日
編集済み: Jeremy 2019 年 12 月 10 日
If you have 217 rows and you're trying to index row 478 then Matlab will throw an error
also, the ,1 will need to be outside the row bracket.
mean(RT([8 12 25 28 30 39 40 48 52 56 58 59 60 63 70 72 97 100 101 102 105 122 123 478 131 132 143 150 164 181 186 191 198 199 211:217],1))
  1 件のコメント
Khayroon Suleyman
Khayroon Suleyman 2019 年 12 月 10 日
THANKYOU IT WORKED PERFECTLY!

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

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