Message in inv function

Hi, (not sure that the GUI specific domain is relevant)

I would like to see the content of the function inv. My problem is: inv(A) prints a message when the matrix A is bad conditioned and I would like to know the condition for the message to be printed. My idea was to look at the sci or C file, but I can’t find such a file on my computer, nor on the Gitlab scilab / scilab · GitLab.



You can look at rcond (does a fast estimate of the inverse condition number), or cond (true condition number, function allows you to choose the matricial norm used).

The C++ gateway of inv is here:

The message about bad condition number reports the inverse condition number


inv already gives the rcond value when the matrix is bad conditioned. I don’t want to run simulation to find the X value in something like “if rcond(input)<X then print the warning message” :slight_smile: Thanks for the link, I will have a look.

See also

the number you are looking for is \sqrt{\epsilon}, hence

--> sqrt(%eps)
 ans  =


Great! Now, I can read the code of iInvertMatrixM defined in invert_matrix.c and all is clear! How did you know that iInvertMatrixM is defined in invert_matrix.c and where is this file? (I’m unable to find that!)

Ok, there are external C includes in sci_inv.cpp… Thanks.

Just go to scilab / scilab · GitLab and type iInvertMatrixM in the search field in the upper left.