Here you can find the source of matrixConcatUL(double[][] UMatrix, double[][] LMatrix)
public static double[][] matrixConcatUL(double[][] UMatrix, double[][] LMatrix)
//package com.java2s; //License from project: Open Source License public class Main { public static double[][] matrixConcatUL(double[][] UMatrix, double[][] LMatrix) { if (LMatrix[0].length != UMatrix[0].length) { System.out//from w w w . ja v a 2 s . c om .println("matrixConcatUL error: the number of columns in two matrix should be same"); System.exit(0); } int numURows = UMatrix.length; int numLRows = LMatrix.length; int numCols = UMatrix[0].length; double[][] newMatrix = new double[numURows + numLRows][numCols]; System.arraycopy(UMatrix, 0, newMatrix, 0, numURows); System.arraycopy(LMatrix, 0, newMatrix, numURows, numLRows); return newMatrix; } }