Select random numbers from a matrix
Ältere Kommentare anzeigen
I want to select 100 random numbers from a certain column of a matrix. What should I do?
1 Kommentar
James Tursa
am 16 Dez. 2017
Provide a short example.
Antworten (1)
Image Analyst
am 16 Dez. 2017
Try this:
y = rand(1000, 3); % Some random data
% Select 100 numbers randomly from column 2:
selected = y(randperm(size(y, 1), 100), 2)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!