How do I convert an integer into a binary vector?
显示 更早的评论
I would like to use the General CRC Generator to calculate a CRC based on 32 bit integer value that is going to be transmitted as serial (ARINC 429 data) using Simulink Real-Time. My 32 bit integer is computed every frame based on a number of dynamic input values. The problem is that the CRC block requires a binary column vector as its input and so I need to create this from my 32 bit integer value. Is there a block that does this? Surely I don't need to pick off each bit individually to create a vector??
Justin
回答(2 个)
dpb
2014-8-8
v=dec2bin(intval)-'0';
Justin Mellor
2014-8-11
0 个投票
1 个评论
dpb
2014-8-11
I've never seen a Simulink installation even, sorry...
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!