, arrayfun, cell2mat :
output = cell2mat(arrayfun(@(start, stop) start:stop, a, b, 'uni', 0))
: arrayfun a b, . , 'UniformOutput', false ( 'uni', 0), arrayfun . , cell2mat, .
:
>> a = [10, 20, 40];
>> b = [13, 22, 45];
>> output = cell2mat(arrayfun(@(start, stop) start:stop, a, b, 'uni', 0))
output =
10 11 12 13 20 21 22 40 41 42 43 44 45