How to round up all components of a matrix to nearest integer number

13 ビュー (過去 30 日間)
Mohammed  Kassem
Mohammed Kassem 2019 年 4 月 14 日
回答済み: Image Analyst 2019 年 4 月 14 日
Hi,
Does anyone know how I can round this 3x3 matrix and take the absolute value of all elements :
M=
5.421 -5.532 0.532
-4.223 6.543 9.334
1.976 -5.123 7.872
to this
M=
5 6 1
4 7 9
2 5 8

採用された回答

Image Analyst
Image Analyst 2019 年 4 月 14 日
M = abs(round(M));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by