define parameters in binary format

2 ビュー (過去 30 日間)
Nikolas Spiliopoulos
Nikolas Spiliopoulos 2018 年 7 月 13 日
Hi everyone,
I'm trying to transmit data using ZigBee with QPSK modulation.
However I don't understand how in matlab I can define particular parameters in a binary format.
so the question is:
If I have 4 parameters ("soc", "user_status","required energy", "user ID")
How can I transform them in Binary format:
for example
soc=0000 user_status=0100 required energy=0010 user ID=0001
thanks
Nikolas

採用された回答

Florian Floh
Florian Floh 2018 年 7 月 13 日
Hi!
If your parameters ("soc", "user_status","required energy", "user ID") are given as a decimal number, you should try the following function:
- dec2bin(decimal) % Convert decimal number to character vector representing binary number
If your parameters are given as a string, you can convert them to a number, by using the following command: - str2num('YourCharacter') % Convert character array to numeric array
I hope this answers your question, if not, please let me know :)
Kind regards
  1 件のコメント
Nikolas Spiliopoulos
Nikolas Spiliopoulos 2018 年 7 月 13 日
yeah thanks a lot!!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by