for (x = 2; x <= n; x++) {
for (z = 1; z <= n; z++){
if (z==i)
{z++}
if (z==n+1)
{break}
M[k,j]= a[x,z]
j++}
should fix the problem.
But there must be more something wrong. With 4*4 matrix still gives wrong answer.
I got something done, but it only works for 2*2 and 3*3 matrices. There must be a mistake. I used the code I found somewhere:
int determinant(int b[5][5],int m) //FUNCTION TO CALCULATE
DETERMINANT
{
int i,j,sum = 0,c[5][5];
if(m==2)
{ //BASE...
I need to inverse a matrix given in a file.
The problem is I'm stuck with writing determinant finding algoritm into code.
I found this algoritm about finding determinant of nxn matrix. This is what i need:
http://www.maths.surrey.ac.uk/explore/emmaspages/option1.html#top
and here:
a11 a12...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.