Hello I am doing timing phase correction in a QPSK system. Given a maximum power timing phase I need to round down to nearest 100.
Example:
If I get 568, I want to get 500.
Round(568,-2) gives 600. I need to always round down. What do you all suggest?

 採用された回答

Voss
Voss 2023 年 12 月 14 日

1 投票

Divide by 100, then floor() or fix() (depending on how you want to handle negative numbers), then multiply by 100.
x = 568;
floor(x/100)*100
ans = 500
fix(x/100)*100
ans = 500
x = -568;
floor(x/100)*100
ans = -600
fix(x/100)*100
ans = -500

2 件のコメント

Grant Brown
Grant Brown 2023 年 12 月 14 日
thanks for the help!
Voss
Voss 2023 年 12 月 14 日
You're welcome!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeElementary Math についてさらに検索

質問済み:

2023 年 12 月 14 日

コメント済み:

2023 年 12 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by