How to expand each element of a vector with ones based on the value of this element.
For example, if vector is: A=[4 2 3 …], then the new vector will be: C=[1 1 1 1 1 1 1 1 1 …]. So, the number of how many ones depend on the value of each element of this vector A.
Thanks, Khalid
Best Answer