package com.imsl.test.example.math; import com.imsl.math.*; /** *
* Prints a matrix with and without row and column labels. *
* * A simple matrix is printed using the default format with the PrintMatrix * class. The PrintMatrixFormat class is then used to change the default format. * * * @see Code * @see Output * */ public class PrintMatrixFormatEx1 { public static void main(String args[]) { double a[][] = { {0., 1., 2., 3.}, {4., 5., 6., 7.}, {8., 9., 8., 1.}, {6., 3., 4., 3.} }; // Construct a PrintMatrix object with a title PrintMatrix p = new PrintMatrix("A Simple Matrix"); // Print the matrix p.print(a); // Turn row and column labels off PrintMatrixFormat mf = new PrintMatrixFormat(); mf.setNoRowLabels(); mf.setNoColumnLabels(); // Print the matrix p.print(mf, a); } }