Update multi dimensions matrix sample with for each cycle.