Return the upper/lower triangular part of a square matrix
function triangle import Modelica_LinearSystems2.Math.Matrices; input Real A[:, size(A, 1)] "Square matrix"; input Boolean upper = true "True for upper triangle to return"; output Real Tri[size(A, 1), size(A, 2)] "Triangular matrix"; end triangle;