Rounding Elements of a Matrix to 3 decimal places

19 ビュー (過去 30 日間)
John hope
John hope 2019 年 4 月 15 日
コメント済み: Star Strider 2019 年 4 月 16 日
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 件のコメント
Rik
Rik 2019 年 4 月 16 日
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
Star Strider 2019 年 4 月 16 日
@John Hope — My pleasure.
If you want engineering notation, use format short eng or format long eng.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by