A solution as mentioned by Daniel
Save your java results in a .txt file that looks like that:
1 2 3
4 5 6
7 8 9
use textscan to convert it into a matlab variable
file= fopen('whatever.txt')
Variable=textscan(file,'%d %d %d')
Hoping this is useful to someone else. Any other ideas are welcome.