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일

0 개 추천

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품

질문:

2021년 2월 22일

댓글:

2021년 2월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by