How to select vectors from a set of vectors
2 views (last 30 days)
Show older comments
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.
Accepted Answer
David Hill
on 15 Mar 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)
More Answers (0)
See Also
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!