Rounding Elements of a Matrix to 3 decimal places
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all
I'm pulling my hair out with this simple but frustrating issue.
I have two matrices In and Out:-


I am trying to create a new matrix called T which is the subtraction of In and Out.
However i want matrix T to be rounded to 3 dp.
This is what i currently get when i use the round function:-

Can anyone help?
Thank you.
9 Commenti
Rik
il 16 Apr 2019
The visual output of values is indeed easier than the method described here:
val=0.43125;
fprintf('%.3f\n',val)
In Matlab the display of data and changing that data are two unrelated tasks.
Star Strider
il 16 Apr 2019
@John Hope — My pleasure.
If you want engineering notation, use format short eng or format long eng.
Risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!