Fix number of decimal digits in MATLAB Table

18 visualizzazioni (ultimi 30 giorni)
Hello,
I have made a long file with many tables in it (using the table() function of matlab). I would like to know whether there is a way to universally apply a function to my file such that all the table numbers come out to only tree decimal digits and not in four or five as they do now.
I have tried using the 'format' commands, however these do not seem to effect the values present in the tables, only those of the vectors. Plus I have not found a 'format' type of command that can apply to the whole file, within the tables too, and have control over the exact decimal places I wish to get.
That's all I would like to know, Thanks for your help in advance!

Risposta accettata

Walter Roberson
Walter Roberson il 13 Nov 2016
No, there is not. You would have to write code to fprintf() the content of the table with the number of decimal places you want.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by