Java Main Program Input String Matlab For Loop