Matrix input/output using ejml
Code: "matrix_ejml_io.py". Programming language: Python
DMelt Version 1. Last modified: 06/20/2015. License: Pro
https://datamelt.org/code/cache/matrix_ejml_io_1049.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from org.ejml.simple import SimpleMatrix
S=SimpleMatrix([[1,2,3,4],[3,4,4,5],[3,3,3,1],[3,3,1,1]])
S.print()
S.print("%e")
S.print("%10.2f");
# save and read
S.saveToFileCSV("matrix_file.csv");
B = SimpleMatrix.loadCSV("matrix_file.csv");
# save in binary form
S.saveToFileBinary("matrix_file.data");
B=SimpleMatrix.loadBinary("matrix_file.data");
You see the box below because you did not login.