- The first 20% of the rows, starting from the first row?
- the first 20% of the columns, starting from the first column?
- the first 20% of the elements, starting from the first element?
- the first 20% of the values, when the values are sorted by value?
- something else?
getting first 20% of a matrix
2 ビュー (過去 30 日間)
古いコメントを表示
I am getting the first 20% of a (290,2) matrix (so a 58,2 matrix). I was just wondering how this is possible. im presuming there are a number of ways but unsure as to how to do it?
1 件のコメント
Stephen23
2015 年 4 月 27 日
編集済み: Stephen23
2015 年 4 月 27 日
What do you mean by the "first 20% of a matrix" ?
採用された回答
Guillaume
2015 年 4 月 27 日
Just use standard matrix indexing:
A = rand(290, 2); %for example;
B = A(1:floor(size(A, 1) * 0.2), :);
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!