How to suppress this error?
Ältere Kommentare anzeigen
Hi there
I am receiving the following error message:
Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN.
> In mpower>integerMpower (line 80)
In ^ (line 49)
In gaussfit (line 111)
The line in question is:
a = (F2)^(-1)*F'*(y-f0) + a0;
I wish to suppress, not solve, this problem and so I added the following to the beginning of my script, and yet still receive the error message. What am I doing wrong?
warning('off','MATLAB:singularMatrix')
4 Kommentare
Sudhakar Shinde
am 25 Sep. 2020
If you are not bothered about other warnings too, does it make sense to suppress all warnings.
warning off;
Walter Roberson
am 25 Sep. 2020
Why are using matrix inversion and matrix multiplication instead of F2\F1 ?
Jakob Sievers
am 25 Sep. 2020
Jakob Sievers
am 25 Sep. 2020
Antworten (2)
the cyclist
am 25 Sep. 2020
Two thoughts:
First: Are you certain you have the correct warning? After you run your code that gives the warning, what is the output of
w = warning('query','last')
(Your warning does look like it matches the one you are turning off, so I'm guessing that's not the issue.)
Second: I believe that turning off warnings only persists for the session. Does this warning happen during the same session in which you turned it off?
1 Kommentar
Jakob Sievers
am 25 Sep. 2020
Real User
am 21 Mär. 2024
warning('off','MATLAB:nearlySingularMatrix')
But the cyclist's answer works for any error (that's how I found this).
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!