select 2 rows in a (n,m) matrix
이전 댓글 표시
what command can be used to select 2 rows in a matrix(10,10),3 rows in a matrix(10,10),4 rows in a matrix (10,10)
답변 (2개)
I suppose you want to randomly sample 1,2 or 3 rows from your matrix.
A = rand(10); % example
noRows = 1;
A_sample = A(randperm(size(A,1),noRows),:);
카테고리
도움말 센터 및 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!