Take percentage of a data set
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
jgillis16
am 28 Jul. 2015
Kommentiert: jgillis16
am 29 Jul. 2015
I need to take 17.65% of a 2016x1 double array (meaning I only want 17.65% of the data in that array).
What would the code for this look like?
Thanks!
1 Kommentar
Akzeptierte Antwort
Walter Roberson
am 29 Jul. 2015
num_to_fetch = round(17.65 / 100 * length(YourVector));
your_subset = YourVector(randperm(length(YourVector), num_to_fetch));
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Types finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!