Java Shift Array Elements And Subscripts In Matlab