fmt=[' +,' repmat('%d,',1,8)];
str=split(sprintf(fmt,vec),' ');
str(1)=[];
>> str
str =
2×1 cell array
{'+,1,2,3,4,5,6,7,8,'}
{'+,9,10,11,12,13,' }
>>
ADDENDUM
Put delimiter at end of record instead--
fmt=['+,' repmat('%d,',1,8) ' '];
>> split(sprintf(fmt,tmp),' ')
ans =
2×1 cell array
{'+,1,2,3,4,5,6,7,8,'}
{'+,9,10,11,12,13,' }
>>
Best Answer