x = rand(2,4); y = zeros(2,4); for (i in 1:2) { for (j in 1:4) { y[i;j] = sin( x[i;j] ); } }