I'm trying to output a Matrix:
M = [1 20 3; 22 3 24; 100 150 2];
Using:
for i=1:3
fprintf('%f\t%f\t%f\n', M(i), M(i+length(M)), M(i+length(M)*2));
end
And the output is turning out something like:
1 20 3
22 3 24
100 150 2
Which is obviously not great. How can I get it so the front of integers are padded with spaces? Like so:
1 20 3
22 3 24
100 150 2
Any ideas?
Thanks!