Round all values in table
72 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I have a table with calculated values. Now I want to round all values to 2 decimals. How can I do that in once for the whole table?
0 Kommentare
Antworten (1)
Scott MacKenzie
am 25 Okt. 2021
Bearbeitet: Scott MacKenzie
am 25 Okt. 2021
I think this achieves what you are after:
% test data
T1 = array2table(rand(5))
% rounded to 2 decimal places
T2 = array2table(round(T1{:,:},2))
0 Kommentare
Siehe auch
Kategorien
Find more on Precision in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!