フィルターのクリア

Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. Assignment has more non-singleton rhs dimensions than non-singleton subscripts

1 回表示 (過去 30 日間)
Bishow Shrestha
Bishow Shrestha 2017 年 10 月 13 日
コメント済み: Jan 2017 年 10 月 15 日
I got this error while debugging. what does it mean. how can i fix it? BEM.m is the main code

回答 (1 件)

Matt J
Matt J 2017 年 10 月 13 日
編集済み: Matt J 2017 年 10 月 13 日
The warning message means that you are trying to invert a singular matrix. Use
>>dbstop if warning
and then re-run to trap the occurrence of this and see if you generated the matrix that you intended.
The error message means that you are trying to do a subscripted assignment, like below, where the right and left sides do not match in size
>> a=rand(3); b=rand(3,3,2);
>> a(1:2,:)=b(1:2,:,:)
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
The usual way to trap these is likewise with the debugger
>> dbstop if error
  4 件のコメント
Bishow Shrestha
Bishow Shrestha 2017 年 10 月 15 日
Thanks. Its a useful code.. still I could not understand the singleton dimension error. Is it related to dimension. does LHS and RHS need to be same dimension?
In the error message rhs dimension means Right hand side ? or something else??
Jan
Jan 2017 年 10 月 15 日
@Bishow: Exactly. RHS means "right hand side". The dimensions on both sides of the equal operator do not match.

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

カテゴリ

Help Center および File ExchangeFunction Creation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by