Okay so I wrote this code with my friend's help to "remove the row" of a matrix, but I don't really understand whats going on with the "for" , can someone explain to me why it's done that way?
Edit: Okay so what i don't understand is the way that both loops are working
public static double [][] removeRow(double [][] m , int n){
double [][] finalm = new double [m.length-1][m[0].length];
for (int i = 0; i<finalm.length; i++) {
for (int j = 0; j<finalm[i].length; j++) {
if (i<n) {
finalm[i][j]=m[i][j];
}
if (i>=n) {
finalm[i][j]=m[i+1][j];
}
}
}
return finalm;
}
public static void main(String[] args) {
double [][] m = {{1,2,3},{1,9,2},{0,6,3}};
double [][] result = removeRow(m,0);
for (int i = 0; i<result.length; i++) {
for (int j = 0; j<result[i].length; j++) {
System.out.println(result[i][j]);
}
}
}
}