Good day, I apologize for the very vague title, I didn't really know how to formulate what I want. However, I can explain what I mean:
I have a vector v1:
v1 = [n1, n2, n3, .... ni]
And I want to create a new vector from this
g1 = [n1-1 zero's, 1, n2-1 zeros, 1, ... ni-1 zeros, 1]
Now, I don't really know where to begin with this. I suppose for the zero's I can just use the command zeros(1,ni-1), but then I don't even know where to begin in imlementing this in Matlab in order to create g1.
I do of course know that the length of g1 will be equal to sum(v1). I suppose maybe it'll have to be some sort of double for loop?
I understand that I'm not giving you much, but I hope that maybe someone could give me a push in the right direction?
You can do it in the following way :