fixed point number conversion

12 ビュー (過去 30 日間)
Robert Scott
Robert Scott 2021 年 8 月 11 日
編集済み: Jesús Zambrano 2021 年 8 月 11 日
Hello
I want to convert some unsigned decimal numbers to a fixed point number
i was previously using the following but seem to be getting an error
Should this be working or am i missing a step
q = quantizer(12,14) % for a 12.4 fixed point number
binary_vector = dec2bin(some_Double_int)
bun2num(binary_vector,q)

回答 (1 件)

Jesús Zambrano
Jesús Zambrano 2021 年 8 月 11 日
編集済み: Jesús Zambrano 2021 年 8 月 11 日
You might try the command fi
For example, converting the value 1.5 to fixed-point signed, with wordlength 10 and fraction length 6, you type:
a = fi(1.5,1,10,6);
See more about this command in the documentation:

カテゴリ

Help Center および File ExchangeFixed-Point Designer についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by