Complement of a vector

조회 수: 10 (최근 30일)
med-sweng
med-sweng 2013년 3월 1일
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
Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 1일
편집: Azzi Abdelmalek 2013년 3월 1일
What is the complement of a real number A?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 3월 1일
Neither of those are sets. A set has at most one copy of any value.
  댓글 수: 2
med-sweng
med-sweng 2013년 3월 1일
Thanks for your reply. I have made an edit to my question and changed that to a vector. So, how can we go about the complement of the vector in this case?
Walter Roberson
Walter Roberson 2013년 3월 1일
What is your desired result in those two cases?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by