i have continous binary stream example 100101001010........ of length n. how can i split these binary numbers of my given size

example .. if i want my m as size..
a=10...m
b=01....m
till my length of binary stream..

3 commentaires

What do you mean continuous? Are you getting this data from some kind of input, like from a USB cable or something? Do you have a variable that fills up with some numbers, then you're supposed to split it apart before it gets overwritten by the next batch of incoming data? Do you have any control over when the next incoming data will come in and blast over your current numbers?
Could you provide an example? How do you define your binary stream? Is it an array of doubles or logicals, or really a blob of "whatever" that should be treated as a binary stream?
i will give input i may give bits of length5 eg: 10101 other may give length 10 1010100100.. i want a matlab program that this binary data (of any length given by user) should split to again to length of user want eg : 1010011001 (10 bit size ) should split into 1010 0110 01 or 10 10 01 10 01 ( sholud split to my given size.

Connectez-vous pour commenter.

 Réponse acceptée

If you have the Communications System Toolbox, use buffer()
If you do not have that toolbox, you can use
rows_of_m = reshape(YourBinaryStream, m, []).';
but this requires that your binary stream be an exact multiple of m long.

Plus de réponses (0)

Catégories

En savoir plus sur Variables dans Centre d'aide et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by