简体   繁体   中英

How to visualize a 2D array of Vectors in Java

I have a 2D array where each element is a fixed length vector. I'm using Java and need to visualize the 2D array in the form of a color matrix (as in Matlab). I want to visualize how the vectors in the 2D array change with time (example:visualized in a loop 0...100).

I need help on the following.

  1. What is the best value to represent each element of the 2D array? (I've used the norm but I want to confirm whether this is standard estimate of the vector)
  2. What is the best possible way to visualize the 2D array mentioned above? (I thought writing my own visualization using Swing. Is there any other methods available which would save time?)

What about int [ ] [ ] matrix = new int [ 100 ] [ 100 ] To visualize it you can simply print it:

for (int i=0; i<rows; i++) { for (int j=0;j<cols;j++) { System.out.println( matrix[i][j]+" "); } System.out.println(); }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM