How to catch/find ''Index exceeds matrix dimensions'' error line?

3 ビュー (過去 30 日間)
Shakir Hussain
Shakir Hussain 2018 年 7 月 4 日
コメント済み: Jan 2018 年 7 月 5 日
We can catch error line by
dbstop if all error
dbstop if error
dbstop if caught error e.t.c
I have no idea how to catch the above mention error(Index exceeds matrix dimensions) line in matlab 2016a?
  2 件のコメント
Geoff Hayes
Geoff Hayes 2018 年 7 月 4 日
Shakir - why can't you use dbstop if error? Are you saying that this doesn't work in r2016a?
Shakir Hussain
Shakir Hussain 2018 年 7 月 5 日
Yes, it does not work for me and the error is not giving any information more than above mentioned one

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

回答 (1 件)

Jan
Jan 2018 年 7 月 4 日
編集済み: Jan 2018 年 7 月 4 日
''Index exceeds matrix dimensions'' error line
This is not the complete error message, but there must be a file name and line number. Then:
dbstop in FILENAME at LINENO
stops there. But this stops also, if no error occurred.
What about:
dbstop if error IDENTIFIER
or in your case:
dbstop('if', 'error', 'MATLAB:badsubscript')
Nevertheless, Geoff's idea should be working already: dbstop if error does catch your error also. So why does this not work?
  2 件のコメント
Shakir Hussain
Shakir Hussain 2018 年 7 月 5 日
I also astonished that why the above mentioned codes are not working
Jan
Jan 2018 年 7 月 5 日
@Shakir Hussain: It would be useful, if you explain the problem you have. "Not working" is not specific enough to allow for a matching solution. Post the corresponding code and explain, what you observe exactly. You can enclose the code in try, ..., catch ME, end and display the contents of ME.

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

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by