MATLAB: How to append a semicolon after every 4 integers

fscanfmatrix arrayserial

I currenty have this code:
C = serial('COM9'); %#ok<SERIAL>
fopen(C);
L = reshape(fscanf(C,'%f, '),[4,4])
And it outputs the following:
L =
74.8000 74.8000 74.8000 74.8000
74.7000 74.8000 74.8000 74.5000
74.7000 74.3000 74.5000 74.7000
74.7000 74.7000 74.7000 74.5000
How can I can matlab to return the above data like this? (with the 2 brackets and semicolons)
L =
[ 74.8000 74.8000 74.8000 74.8000;
74.7000 74.8000 74.8000 74.5000;
74.7000 74.3000 74.5000 74.7000;
74.7000 74.7000 74.7000 74.5000 ]
I need it to be this way so that I can plot the data using a grid.
Thank you in advance.

Best Answer

regexprep(mat2str(L), ';', ';\n')
I need it to be this way so that I can plot the data using a grid.
No you do not, not unless you have some external software that needs exactly that format. MATLAB is happy with the L that you already got.