How to merge 2 data?

조회 수: 2 (최근 30일)
wael elsisi
wael elsisi 2021년 7월 18일
댓글: wael elsisi 2021년 7월 19일
How to write the blow code in MATLAB Analysis ?
int16_t send_windSpeed =((msg[0] << 8) + msg[1]) ;

답변 (1개)

Yongjian Feng
Yongjian Feng 2021년 7월 18일
편집: Yongjian Feng 2021년 7월 18일
Are you looking for bitshift function? Something like:
send_windSpeed = bitshift(msg(0), 8) + msg(1);
  댓글 수: 3
Yongjian Feng
Yongjian Feng 2021년 7월 19일
What is msg in your original code please?
wael elsisi
wael elsisi 2021년 7월 19일
msg[0] = (send_windSpeed >> 8) & 0xFF; // highest byte
msg[1] = (send_windSpeed ) & 0xFF; // lowest byte
my_mkr.uplink(msg, 2);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by