フィルターのクリア

How to round only two values after decimal point

2 ビュー (過去 30 日間)
Akshay Math
Akshay Math 2020 年 3 月 1 日
コメント済み: stozaki 2020 年 3 月 1 日
Hi guys,
I have following block set up and i want 24.02==24.021 but i am getting output as 0 so how can i round the input to consider only two values after decimal point.

採用された回答

Akshay Math
Akshay Math 2020 年 3 月 1 日
First multiply with 100 for two values after decimal then convert into integer and divide by 100.

その他の回答 (1 件)

stozaki
stozaki 2020 年 3 月 1 日
You can use 'round' block and 'subtract' block.
  4 件のコメント
Akshay Math
Akshay Math 2020 年 3 月 1 日
Thanks stozaki, however this worked for me
First multiply with 100 for two values after decimal then convert into integer and divide by 100.
stozaki
stozaki 2020 年 3 月 1 日
@ Akshay
Thank you for trying the data type conversion block. I understand that the location of the binary points was different because you were using a Gain block.
Regards,
stozaki

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by