Randomly select a column
10 次查看(过去 30 天)
显示 更早的评论
n= 3*100 matrix
i want to select 20 non repeating random column
so, final matrix will be
x=3*20 ;
where 3 rows should be the corresponding column value of the original matrix
Any help would be really appreciated.
Thanks
2 个评论
Torsten
2022-6-4
Why do you ask the same question again ?
Here is (again) the answer:
x=n(:,sort(randperm(100,20)))
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!