Removing elements in an array

조회 수: 1 (최근 30일)
Raahul Palanivel Uma
Raahul Palanivel Uma 2016년 8월 17일
댓글: Raahul Palanivel Uma 2016년 8월 17일
Hello all. I have 2 very large Arrays (A = [10 20 30 ... 1800] and B = [1.385 1.419 1.527 .... 6.485]) of the same size. I have removed certain elements in B since they are not monotonic for my Interpolation function. How do I remove the corresponding elements in A as well? i.e. if if remove 4.834, in the Position 145 of the Array, how do i remove the element no. 145 in A as well. There are approx 60 such repeating elements in a single Array like B & I have 8 Arrays totally. Could anyone please help me with a solution. Thank you in advance

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 8월 17일
편집: Azzi Abdelmalek 2016년 8월 17일
A=[1 2 3 4]
B=[5 10 15 20]
c=[10 20] %numbers to remove from B
idx=ismember(B,[10 20])
A(idx)=[]
  댓글 수: 1
Raahul Palanivel Uma
Raahul Palanivel Uma 2016년 8월 17일
thank you... i have modified the function you have mentioned to determine the values i need

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by