フィルターのクリア

how can I delete some rows from a matrix

11 ビュー (過去 30 日間)
momo
momo 2024 年 4 月 5 日 11:03
回答済み: Star Strider 2024 年 4 月 5 日 11:11
Hello,
I have a matrix with 3 col and many rows, I need to to create a new matrix with only odd romws numbers and delet the pair rows.
Someone have an idea how I can do this?
Thank you very much

回答 (1 件)

Star Strider
Star Strider 2024 年 4 月 5 日 11:11
This creates a new matrix with only the odd rows from the original matrix —
A = randi(9, 10,3)
A = 10x3
4 5 3 5 5 5 7 3 9 3 4 5 5 7 8 2 4 4 3 4 3 5 2 9 2 5 3 7 4 2
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Anew = A(1:2:end,:)
Anew = 5x3
4 5 3 7 3 9 5 7 8 3 4 3 2 5 3
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
See the documentation section on Matrix Indexing for more information.
.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by