>> fmt=['%04d' repmat('%6.2f',1,size(results,2)) '\n'];
>> fprintf(fmt,[[1:size(results,1)].' results].')
0001 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0002 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0003 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0004 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0005 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0006 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
>>
You have to transpose the output array to display in row-major order--Matlab internal storage order is colum-major.
Best Answer