The output vector should look like :
a=[3 3 3 4 4 4 4 5 5 5 5 5]
What i have is:
pe=[1 5 9] and ne=[4 8 12] and co=[3 4 5]
pe describes the starting index and ne the ending index from each entry and co the value of this entry
I want do this without loop.
With Loop it should look like this:
for i=1:3
a(pe(i):ne(i))=co(i)
end
One way to do this is to create an array of indices into
cofirst, usingcumsum