Complement of a vector
6 次查看(过去 30 天)
显示 更早的评论
Say I have a vector with some values, and I want to create a new vector that is the complement of that defined set. How can I do this in `matlab`? And, if my defined vector contains only values of `0s` & `1s`, will that differ at all?
*EDIT*
Say for example that the vecotrI want to find the complement of is `A`, such that:
A = [3 4 56 6 5 4 43 32 4 5 6 4 3 43];
Also, in another different situation, say that `A` is as follows:
A = [0 1 1 1 1 1 1 0 0 0 0 1];
How can I create a vector that is the complement of `A` for the above two cases?
Thanks.
1 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!