XOR operation of double values?
5 views (last 30 days)
Show older comments
I have a chaotic sequence of 65536 values in sy and the binary equivalent is stored in sybin as type double. Sybin has 65536 binary values as a column matrix and i need to xor some integer values in the following steps with sybin(i) where i=1,2,3,... So i convert those integer values to binary. But i couldnot xor it because i cant access the 8 bits from sybin (sybin(1)) comletely. Please help me with this.
2 Comments
James Tursa
on 23 Jan 2018
Pleas provide a short example of your problem, not just a worded description. Show the values of a few samples, tell us the exact class and size of the variables, show us the current code you are using, and tell us what seems to be going wrong and what the desired output should be.
Answers (1)
Jan
on 23 Jan 2018
James' comment is very useful. Currently answering requires too much guessing to be efficient. But I try it:
xor works on variables of type double directly. There is no need to convert them to char vectors (also called "binary", but this is a weak interpretation). Try this:
a = randi([0, 255], 1, 10)
xor(a, 17)
2 Comments
Steven Lord
on 13 Mar 2020
Define "doesn't work".
Does your code throw an error? If so show us your code (and a brief description of what your code does if it's not obvious) and the full and exact text of the error message you recieved (all the text displayed in red.)
Does your code issue warnings? If so do as in the error case but show the text of the warning message(s) displayed in orange.
Does your code give different answers than you expect? If so, show us your code and explanation, explain what answers you expected the code to give, and show what answers it actually gave.
If you meant something else, please give more details.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!