Hi
I need to generate a vector (0's and 1's), when I'm given indices for the starting and endpoints of the 1's trains.
Example: m=zeros(1,10); starts=[1 5 9]; ends=[3 6 9];
the generated vector should be [1 1 1 0 1 1 0 0 1 0]
Any way of avoiding a loop? [starts(:):ends(:)] only looks at the first entry of the source vectors…
thanks Tozé
Best Answer