フィルターのクリア

Removing data from matrix

1 回表示 (過去 30 日間)
sooraj ajith
sooraj ajith 2021 年 2 月 22 日
コメント済み: sooraj ajith 2021 年 2 月 22 日
Hi, i have a set of n x 3 matrix. Such as A = [1 0 0;2 0 0 ; 3 0 0; 4 0 0 ]. I have my initial value, like [4 0 0 ]. I want to find my initial value from matrix and delete that row from my the matrix

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 2 月 22 日
編集済み: KALYAN ACHARJYA 2021 年 2 月 22 日
One way:
int_dat=[4 0 0];
A =[1 0 0;2 0 0 ; 3 0 0; 4 0 0];
[r,c]=size(A);
idx=A==int_dat;
row_num=find(sum(idx')==c);
A(row_num,:)=[]
Result:
A =
1 0 0
2 0 0
3 0 0
  1 件のコメント
sooraj ajith
sooraj ajith 2021 年 2 月 22 日
Thanks for clearing

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by