Visualize a (dense) matrix
Code: "matrix_ejml_vis.py". Programming language: Python DMelt Version 1. Last modified: 05/26/2016. License: Pro
https://datamelt.org/code/cache/matrix_ejml_vis_6784.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.ops import RandomMatrices
from java.util import Random
from org.ejml.ops import MatrixVisualization
from org.ejml.data import DenseMatrix64F

A=DenseMatrix64F(4,4,True,[0,2,3,4,-2,0,2,3,-3,-2,0,2,-4,-3,-2,0])

# Creates a window visually showing the matrix's state. 
# Block means an element is zero. Red positive and blue negative. 
# More intense the color larger the element's absolute value is.
MatrixVisualization.show(A,"Small Matrix");

B = DenseMatrix64F(25,50)
for i in range(25): 
      B.set(i,i,i+1)
MatrixVisualization.show(B,"Larger Diagonal Matrix")



You see the box below because you did not login.