I would like to display comma-separated records like the following,
Record1,2,8,3,5,2,6,3,7,7,7
Here's my attempt, but is there a less clunky way?
% Make the record label string
iRecord = 1;strLabel = ['Record' num2str(iRecord)];% Make the number vector
numberList = round(rand(1,10)*10);% Turn number vector into a string
numberListIntoString = sprintf('%d,', numberList);% Remove comma at end
numberListIntoString = numberListIntoString(1:(end-1)); % Display the result
disp([strLabel ',' numberListIntoString])
Best Answer