C = {'p.1001',100.500,250.350,;'102',110.550,255.220;'m285',115.210,266.333};fileID = fopen('celldata.dat','w');formatSpec = '%s %15.3f %15.3f\n';[nrows,ncols] = size(C);for row = 1:nrowsfprintf(fileID,formatSpec,C{row,:}); end fclose(fileID);
% in this case second and third columns cannot be vertically aligned in the text file because first columns' characters are different size. When I use tab (/t), the situation is still same. Is there any way to vertically align 2rd and 3rd columns as independently the 1st columns' characters size?
Best Answer