How to delete multiple of the Value in Array

조회 수: 6 (최근 30일)
Med Future
Med Future 2022년 12월 20일
댓글: Rik 2022년 12월 29일
Hello, I have the following array I want to delete the values, which are multiple of any values
How can i do that in MATLAB
  댓글 수: 1
Rik
Rik 2022년 12월 29일
Why did you post a duplicate question instead of responding that this isn't what you wanted?

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

채택된 답변

C B
C B 2022년 12월 20일
A = [1 2 3 4 5 6 7 8 9 10] % Initial array
A = 1×10
1 2 3 4 5 6 7 8 9 10
A(mod(A,3) == 0) = [] % Delete elements that are multiples of 3
A = 1×7
1 2 4 5 7 8 10

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by