フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How do I delete rows from a matrix based on the number of the row.

1 回表示 (過去 30 日間)
Patrick Guarente
Patrick Guarente 2017 年 9 月 1 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have matrix A=[ 15 2 4; 19 3 7; 12 2 6; 10 4 9]
A second matrix which tells me the rows of A that need to be deleted.
BadA= [ 1; 3 ]
My matrices are much bigger but for right now this kind of simulation on smaller matrices will work.
Thank you

回答 (1 件)

Star Strider
Star Strider 2017 年 9 月 1 日
Assign the rows that need to be deleted to the empty array ‘[]’:
A = [ 15 2 4; 19 3 7; 12 2 6; 10 4 9]
BadA= [ 1; 3 ];
A(BadA,:) = []

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by