# Thread: Row-echelon form of a matrix

1. ## Row-echelon form of a matrix

If any of you know what it means for a matrix to be in row-echelon form, I'm trying to create some code to check if a matrix is in that form, and if not put it in that form. Any ideas?

2. What is the use of Row-Echelon form, Leeman? Is there one, or are you trying to make a program to do your math homework? Just curious.

3. Well, it's going to be a program that solves systems of equations. Yes, for my homework.

4. What I mean by "for my homework" is pre-calc homework lol. Not programming homework.

5. If all you want it for is your homework then do you have a graphing calculator. I know the TI-86 and TI-89 both can do what you ask. I own both and find the TI-86 easier to use when working with matrices.

James

6. Of course I could just do it with my calculator. Much more fun to make a program though.

7. reduced-echelon form:

1 x y
0 1 z
0 0 1

Code:
```// begin program

int matrix[3][3];  // to hold matrix
bool echelon=TRUE;

// fill matrix in here

if(matrix[0][0]!=1 ||
matrix[1][0]!=0 ||
matrix[1][1]!=1 ||
matrix[2][0]!=0 ||
matrix[2][1]!=0 ||
matrix[2][2]!=1)
echelon=FALSE;

if(ecelon)
cout>>"echelon";
else
cout>>"not ecelon";

// end program```
row-echelon form:

x y z
a b c
0 0 0

Code:
```// begin program

int i;
int matrix[3][3];  // to hold matrix
bool echelon=TRUE;

// fill matrix in here

for(i=0;i<3;i++)
{
if(matrix[2][i]!=0)
echelon=FALSE;
}

if(ecelon)
cout>>"echelon";
else
cout>>"not ecelon";

// end program```
i'm not doing all your homework for you... just fill in the cout in the 'else' with code to put it in the lowest form if it's not already... but good luck with that...