getting warning Warning: BITSHIFT(A,K,N) will not accept integer valued input N in a future release. Use BITSHIFT(A,K,ASSUMEDTYPE) instead. like for following problem.
4 views (last 30 days)
Show older comments
in getmapping() method
j = bitset(bitshift(i,1,samples)),1,bitget(i,samples));
3 Comments
Tazeem
on 6 Feb 2020
Hi Rathnakar Shetty P can you please help me how you removed this error. what were the exact changes you performed.
Walter Roberson
on 6 Feb 2020
Which case do you have? Are your values signed or unsigned? How many bits do you need to work with? What datatype is being used?
If you need to work with say 12 bits in a uint16 then are those the 12 most significant bits (with last 4 bits 0) or the 12 least significant bits (with the upper 4 bits 0)?
Analog to digital converters often store into the most significant bits, whereas bitmasks for graphics are often the least significant bits.
Some people try to use bitset with steganography or watermarks when they are using floating point values. Such code is most often a mistake.
Answers (1)
Walter Roberson
on 27 Apr 2018
Correct, MATLAB removed that feature.
There is no replacement except in the case where the integer is 8, 16, 32, or 64, in which case you give a character vector that is the name of the data type to work with, such as 'uint8'
If you are trying to work with a number of bits that is not a power of 2 that is a multiple of 8, you will need to adjust your code. You would need to sign-extend your value to the next higher power of 2, do the bit shift, then remove the extra bits.
2 Comments
Steven Lord
on 27 Apr 2018
Walter is correct. According to the Release Notes we first announced that you should replace the numeric third input N of bitshift with a type name (the assumedType input) in release R2012b, started warning about using a numeric N input in release R2013b, and started throwing an error for a numeric N input in release R2014b.
Rathnakar Shetty P
on 28 Apr 2018
Thank you very much for the quick responses. Being a beginner I was not able to make out the differences. Thank you for linking the Release notes.
See Also
Categories
Find more on Point Cloud 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!