Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
import java.text.NumberFormat;
import java.text.DecimalFormat;
@ComponentInfo(name="Matrix2String", category="ODE")
public class Matrix2String implements {
private static final long serialVersionUID=1L;
public String print(@ParamInfo(name="Matrix", options="serialization=false") double[][] matrix) {
DecimalFormat df = new DecimalFormat("0.0000")
StringBuilder sb = new StringBuilder();
for (int i = 0; i < matrix.length; i++) {
sb.append("| ")
System.out.print("| ")
for (int j = 0; j < matrix[i].length; j++) {
String entry = df.format(matrix[i][j]).replace(",",".") + "\t"
return sb.toString()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment