<div class="gmail_quote"><div>Hello, </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <br> <br> <br>
-->det(A)<br>
ans =<br>
<br>
6.661D-16 <---------- it should be 0<br>
<br>
-->inv(A)<br>
ans =<br>
<br>
10^15 *<br>
<br>
- 4.5035996 9.0071993 - 4.5035996 <br>
9.0071993 - 18.014399 9.0071993 <br>
- 4.5035996 9.0071993 - 4.5035996 <---------- it should appear<br>
an error message because the matrix A is not invertible (or singular).<br>
<br>
<br>
-->det(inv(A))<br>
ans =<br>
<br>
9.007D+15 <-------------- The determinant of invertible matrix A^(-1)<br>
does not exist.<br>
<br>
Other example:<br>
<br>
-->B = [1 1; 1 1]<br>
B =<br>
<br>
1. 1. <br>
1. 1. <br>
<br>
-->det(B)<br>
ans =<br>
<br>
0. <-------- it is correct !!<br>
<br>
-->inv(B)<br>
!--error 19 <-------- it is correct !!<br>
<br>
<br>
The previously examples show two integer matrices A and B. The determinant of<br>
matrix A is quite zero, but not,<br>
and this can propagate an error in case the Scilab developer uses that result<br>
into other future calculations or algorithms.<br>
The determinant of matrix B is equal to 0 and the answer is correct. In case the<br>
Scilab developer uses that value,<br>
he or she can use the simple statement for testing like to:<br>
if ( det(matrix) <> 0 ) then<br>
<action 1> // The Scilab developer knows that the matrix is<br>
invertible (or nonsingular)<br>
else<br>
<action 2> // The Scilab developer knows that the matrix is<br>
not invertible (or singular)<br>
end<br>
<br>
My doubt: "How can I proceed to design any algorithm, which uses matrix, if the<br>
determinant of<br>
<br>
the matrix could not be zero and, as the same time, that matrix is not<br>
invertible ?".<br>
How can I manage this uncertainty ?<br>
<br>
</blockquote></div>clean(det(A))<br>clean(inv(B))<br clear="all"><br><div>This will return value as zero if it is near to zero.<br>-- <br>Manjusha S. Joshi <br>P.I. of project on Use of Open source software for Teaching Maths,<br>
<a href="http://fossme.bprim.org" target="_blank">http://fossme.bprim.org</a><br>Lecturer in Computational Mathematics, <br>BIM, Pune, India. <a href="http://www.bprim.org" target="_blank">www.bprim.org</a><br>Mobile: 09822 319328<br>
blog:<a href="http://manjushajoshi.wordpress.com/" target="_blank">http://manjushajoshi.wordpress.com/</a><br><br> <br>
</div>