필터 지우기
필터 지우기

How to select vectors from a set of vectors

조회 수: 3 (최근 30일)
charu shree
charu shree 2023년 3월 15일
댓글: charu shree 2023년 3월 17일
Hello all, Suppose I have a set of vectors where
My query is how can we select any vector from set 𝒥and form a matrix of dimension 5 by 500, where 5 corresponds to dimesion of such that n is from 1 to 8 and 500 corresponds to 500 's.
Any help in this regard will be highly appreciated.
  댓글 수: 2
Jan
Jan 2023년 3월 15일
Your x[n] have the dimension 5. You have 8 of them. Therefore I'm confused by your 8 and 500.
What is the purpose to select "any vector"? Do you ask for the vertcat command?
If the x[n] are binary vectors, 500 of them with 8 elements cannot be unique: 2^8=256.
charu shree
charu shree 2023년 3월 15일
Thank you so much sir for your response.
By mistake I had written 8 by 500. Now its corrected . It should be 5 by 500.
Also, the purpose to select any vector is that from a set we can choose any vector.

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

채택된 답변

David Hill
David Hill 2023년 3월 15일
x=[1 1 1 1 0 0 0 0;1 0 0 0 1 1 1 0;0 1 0 0 1 0 0 1;0 0 1 0 0 1 0 1;0 0 0 1 0 0 1 0];
r=randi(8,1,500);
y=x(:,r)
y = 5×500
0 1 0 0 0 1 1 0 1 0 1 0 0 0 0 1 1 1 0 0 0 1 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 1 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 0 1 1 0 0 0 0 0 1 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 1 1 0 1 0 0 0 0 0 1 1 1 0 1 0 1 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 0 1 0
  댓글 수: 1
charu shree
charu shree 2023년 3월 17일
Thank you so much sir for your detailed answer...

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

추가 답변 (0개)

카테고리

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