Hello Heinz,

Le 07/02/2022 à 18:35, Heinz Nabielek a écrit :
Sorry, colleagues  -   please help, I have just a mental blockade.

Given vector EE= [3 5 8]

I want to create a stepwise increasing vector E= [0 0 1 1 2 2 2 3 3 3 3]

And would need a system that works for much larger numbers....

Probably dead easy?


--> v = zeros(1,15);
--> v([3 5 8]) = 1;
--> cumsum(v)
 ans  =
   0.   0.   1.   1.   2.   2.   2.   3.   3.   3.   3.   3. 3.   3.   3.


HTH
Samuel

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to