Deleting specific Rows in a matrix

8 ビュー (過去 30 日間)
James
James 2014 年 4 月 7 日
回答済み: Ondrej Budac 2014 年 4 月 7 日
Hi,
I have a matrix "A" that is 350x1 matrix, so it is a very large matrix. This matrix has about 40 rows that I want to remove. I know these rows and they are stored in another matrix "B", which is a 40x1 matrix. How do I delete the rows that are listed in matrix "B" from matrix "A"?

採用された回答

Joseph Cheng
Joseph Cheng 2014 年 4 月 7 日
you can do this
A(B)=[];
This will delete the rows from A given the numbers that are stored in B.

その他の回答 (1 件)

Ondrej Budac
Ondrej Budac 2014 年 4 月 7 日
If your matrix B has the row indices, it suffices to write
A(B) = [];

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by