How to select vectors from a set of vectors
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
charu shree
am 15 Mär. 2023
Kommentiert: charu shree
am 17 Mär. 2023
Hello all, Suppose I have a set of vectors
where
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1324975/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1324980/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1324985/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1324990/image.png)
Any help in this regard will be highly appreciated.
2 Kommentare
Jan
am 15 Mär. 2023
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.
Akzeptierte Antwort
David Hill
am 15 Mär. 2023
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)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!