MATLAB: Adding semicolon into data

vector

Hi guys, I'm using Matlab 2014b (I don't have access to a better version) and I have a set of data like this:
A=x1,x2,x3,x4,x5,x6,…,xn
I need to add a semicolon for every pair, so I get sth like this:
A=x1,x2;x3,x4;…;xn-1,xn
How can I do that?
I created A using dlmwrite, but when I try to use delimeter in this function I get the following error:
"Delimeter is not a valid attribute or delimiter. Delimiter must be a single character"
Can anybody help?
I don't have access to writematrix function.

Best Answer

From another post:
Try this low-level code:
-----------------------------------------
x = randi(9,[1,2*6001]); % ACTUAL DATA
fileID = fopen('data.txt','w');
for k = 1:2:numel(x)-1
fprintf(fileID,'%g,%g;',x(k),x(k+1));
end
fclose(fileID);
-----------------------------------------
Enjoy!