Roundation In Binary Problem
1 次查看(过去 30 天)
显示 更早的评论
Hello everyone, I need a programme help. I think it will be obvious if I will examine it with an example.
Consider we have a matrix (6x6) in binary;
0 0 1 0 1 0
0 1 1 0 1 1
y= 1 0 0 0 1 0
0 1 0 1 1 0
0 0 0 1 0 1
0 0 0 0 0 1
I would like to make roundation. Means it will look the rows' one by one, if the last number is 1, it will add 1 to the number (in binary) and in the end it will return matrix 5x5 (for this example).
For this example:
0 0 1 0 1
0 1 1 1 0
y= 1 0 0 0 1
0 1 0 1 1
0 0 0 1 1
0 0 0 0 1
And it should do it for any matrix which is (nxn)
Thanks from now ;)
2 个评论
Image Analyst
2012-11-6
I don't understand. I've never heard of "roundation". What does "Add 1 to the number in binary" mean? If it's binary (logical) adding 1 will still leave it at 1 - it will get clipped. And how does doing that chop off the last column?
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!