フィルターのクリア

is it possible to divide a decimal number into 3 decimal numbers?

1 回表示 (過去 30 日間)
Ahmef Alhajsalem
Ahmef Alhajsalem 2019 年 3 月 17 日
コメント済み: Ahmef Alhajsalem 2019 年 3 月 17 日
Hello everybody,
I want to break a 12-bit decimal number into 3 decimals numbers. FOR EXAMPLE. 1000 decimal = 0b 0011 1110 1000 = 3, 13 and 8 in decimal numbers.

採用された回答

Stephen23
Stephen23 2019 年 3 月 17 日
編集済み: Stephen23 2019 年 3 月 17 日
>> N = 1000;
>> R = 3;
>> C = R+R*fix(log2(N)/R);
>> M = reshape(dec2bin(N,C),[],R).'
M =
0011
1110
1000
>> bin2dec(M)
ans =
3
14
8

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by