Sorry for my dumb question, i'm new on matlab. I have an matrix array like this
num = [
4.2, 3, 5;
3, 12.1, 3.4;
2, 5.22, 4
]
I just want to display it using center align format, like the example below
but number in num array is dynamic, sometimes on each row contain up to 4 or more number like this
num = [
4.2, 3, 5, 7.899;
3, 12.1, 3.4, 89;
2, 5.22, 4, 9.1
]
I was trying using num2str() function, but it doesn't fit on my case because my data is dynamic (sometimes it always have 2 or 3 more digit of decimal number) here is my code:
num2str('%10.1f \t %10.1f \t %10.1f \n', num);
Is there any other function beside using num2str(), because my array data is dynamic