Java Matrix Print printMatrix(int m, int n, double[][] a)

Here you can find the source of printMatrix(int m, int n, double[][] a)

Description

print Matrix

License

Open Source License

Declaration

public static void printMatrix(int m, int n, double[][] a) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static void printMatrix(int m, int n, double[][] a) {
        int i, j;

        for (i = 0; i < m; i++) {
            for (j = 0; j < n; j++)
                System.out.print("  " + a[i][j]);
            System.out.println();
        }//w  w w.  ja v a 2  s.com
        System.out.println();
    }

    public static void printMatrix(int m, int n, double[] a) {
        int i, j;

        for (i = 0; i < m; i++) {
            for (j = 0; j < n; j++)
                System.out.print("  " + a[i * n + j]);
            System.out.println();
        }
        System.out.println();
    }
}

Related

  1. printMatrix(double[][] matrix)
  2. printMatrix(double[][] sims)
  3. printMatrix(final double m[][])
  4. printMatrix(float[] array, int rows, int columns)
  5. printMatrix(int M, int N, double mat[][])
  6. printMatrix(int matrix[][])
  7. printMatrix(int[] array, String format, int width)
  8. printMatrix(int[][] M)
  9. printMatrix(int[][] matrix)