Trouble keeping three decimal places in my output
1 view (last 30 days)
Show older comments
I have two matrices with outputs from a for loop. After the loop, I compose the matrices into arrays with three decimal places for each entry. I don't want the outputs as strings so I used str2double to convert back to numbers. Then the matrices get put into table for display purposes. Somewhere along the way, I think in the str2double step, I loose the three decmial accuracy for some but not all my entries. Any ideas on how to better get this done?
Output 1: Output from above code as is
Output 2: Partial output from above code but without lines 256 and 257 active
Basically I want the exact values of Output 2 displayed as Output 1 has them displayed.
0 Comments
Answers (1)
Walter Roberson
on 21 Oct 2020
There is limited control over the way that table objects display values. table objects respond to the active setting for format, and sometimes respond to the width of the command window (in determining how many values to output). There is no way to control the number of digits other than "format bank"
0 Comments
See Also
Categories
Find more on Data Type Conversion 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!