フィルターのクリア

Take percentage of a data set

3 ビュー (過去 30 日間)
jgillis16
jgillis16 2015 年 7 月 28 日
コメント済み: jgillis16 2015 年 7 月 29 日
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 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 28 日
If a=4; what is 17.65% of a?

サインインしてコメントする。

採用された回答

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));
  1 件のコメント
jgillis16
jgillis16 2015 年 7 月 29 日
Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by