How to delete Multiple of any Value in Array In MATLAB
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,I Have the following dataset, I want to delete the value which are multiple of any value present in array.
For example in this array 70 is present which is multiple of 35.
댓글 수: 0
채택된 답변
Dyuman Joshi
2022년 12월 27일
편집: Dyuman Joshi
2022년 12월 27일
y=load('multiple.mat').Value;
%all the different value present in the array
z=unique(y)
for j=unique(y)
y( (rem(y,j)==0) & y~=j )=[];
end
y
댓글 수: 5
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!