Date: Mar 15, 2013 4:11 AM
Author: Bruno Luong
Subject: Re: vectorizing

ind = [1, 25, 50, 70, 100, 110]
val = [1 2 4 6 10 ]

a = zeros(1, ind(end));
a(ind(1:end-1)+1) = diff([0 val]);
a = cumsum(a)

% Bruno