I forgot to test a=~ones(n,m). I guess this is the overall winner (from Stéphane Mottelet): Scilab 5.5.1: 0.2964019 Scilab 6.0.0: 0.5616036 Jan