Round all values in table
52 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Scott MacKenzie
on 25 Oct 2021
Edited: Scott MacKenzie
on 25 Oct 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 Comments
See Also
Categories
Find more on Logical 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!