public static void printMatrix(double[][] matrix)
    {
        StringBuffer sb = new StringBuffer();
        sb.append('[').append('\n');
        for ( double[] line : matrix ) {
            for ( double column : line ) {
                sb.append(column).append(", ");
            }
            sb.append('\n');
        }
        sb.append(']');
        System.out.println(sb.toString());
    }
public static void printMatrix ( double [ ] [ ] matrix ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( '[' ) . append ( '\n' ) ; for ( double [ ] line : matrix ) { for ( double column : line ) { sb . append ( column ) . append ( ", " ) ; } sb . append ( '\n' ) ; } sb . append ( ']' ) ; System . out . println ( sb . toString ( ) ) ; }
print the specified matrix

@param   matrix