Index in position 2 exceeds array bounds

1 回表示 (過去 30 日間)
JITHIN P M
JITHIN P M 2021 年 3 月 26 日
コメント済み: JITHIN P M 2021 年 3 月 26 日
E, day 160
loop = 1
Frequency 0.05625
Frequency 0.06875
Frequency 0.08125
Frequency 0.09375
Index in position 2 exceeds array bounds.
Error in extrema2 (line 73)
im = unique([smaxcol(:,1);smincol(:,1)]); % Rows with column extrema
Error in bf_13BBstar (line 267)
[beammax,imax,beammin,imin] = extrema2(all_stacked_int);
This is the error that is comming while am running the code. Can anyone please help me to sort out the issue. My work is pending due to this error.

回答 (1 件)

KSSV
KSSV 2021 年 3 月 26 日
This error occurs when you try to extract more number of elements/ rows/ columns than present in the matrix.
Example:
A = rand(5) ; % matrix of size 5x5
A(1,:) % first row, no error
A(5,:) % last row no error
A(6,:) % there is no 6th row , so error
In your case also samething is happened. Check the dimensions of the matrix properly when you are trying to extract rows/ columns.
  3 件のコメント
KSSV
KSSV 2021 年 3 月 26 日
Learn about debugging.
JITHIN P M
JITHIN P M 2021 年 3 月 26 日
Respected sir, am actually new to matlab. I have only littlebit knowleadge about coding. One of my profesor send me the full codes with data. He find his results while runing this code. But when i am running this error is showing. I dont know what to do. Can you help me out to solve the issue ??

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

カテゴリ

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