What Im thinking about is looping over the input itself by two for loops and every time check the multiple parametr, but still confused about the replications of the value itself like 00 or 11 or 0011 or 1100
Restoring the multiplications values
16 views (last 30 days)
Show older comments
Hello .
Im struggling to implement a function in matlab that restore stream of binary values according to specific scheme that Im attaching a photo for it:my function called restore (or whatever you'd call it it's fine for me) and have two inputs, one input called arr, second input is a variable/parameter called multiple.
first input is arr and it's a binary values like arr=[11001100110011001100111100] ;
second input as string="0101000100001111111111100000001000010100010000111111111110000011000" , substring is always constant and it's "0101".
00010000-> 16 in decimal.
so here the output is the 16 followed data after ("00010000") which it's: 1111111111100000 , how do I know the length of my following data? it's given in the String itself immediately after appearance of substring "0101" and the length is always 8bit !, so here in my question the immediate 8bit followed to my substring ("0101") represents the following data after those 8bit, so here the immediate following 8bit after appearance "0101" is 00010000 and in decimal It's 16 , this 16 is the length of the data that I want to take/output after the 8bits that represetns the size of the following data, so here in my case I look at "0101" and then I must read the 8bit that immediately following it , that 8bit represents the length, so I need to convert the 8bit in decimal value (in my case it's 16) and take all the following data that comes after that 8bit of length represenation which its size is represented in binary in the immediate 8bit followed by occurrence substring(by occurance "0101") ; As a result the output here is 1111111111100000.
the output is:
output=[1111111111100000 ; 1111111111100000] , each row again represents respectively all following data at each occurrence, and first row represents first occurrence, second row represents second occurrence ....respectively ..etc
Another example:
String="01010000111111111111111000001000100101000011111111111111100010111111" , substring is always constant and it's "0101".
0 Comments
Answers (1)
See Also
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!