Take percentage of a data set

4 次查看(过去 30 天)
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!

采纳的回答

Walter Roberson
Walter Roberson 2015-7-29
num_to_fetch = round(17.65 / 100 * length(YourVector));
your_subset = YourVector(randperm(length(YourVector), num_to_fetch));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by