E = [4 4 9];n = sum( E );I = zeros( 1, n );I(cumsum( [ 1 E(1:end-1) ] ) ) = 1I = cumsum( I )
Standard input is empty
I = 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 I = 1 1 1 1 2 2 2 2 3 3 3 3 3 3 3 3 3
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!