필터 지우기
필터 지우기

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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by