How to randomly select information from an existing matrix

1 view (last 30 days)
Hello,
I currently have a matrixA, which is a matrix of [20000 x 200] with each cell in this matrix containing a corresponding value.
I need to randomly select parts of the matrix in a way that it will generate smaller matrix which is [150 x 200] in size containing information randomly sourced from the values in the original matrix.
Any tips or advice on how I can run the code? Thank you.

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 10 Feb 2016
out = A(randperm(20000,150),:); % One way

More Answers (0)

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!