How to delete Multiple of any Value in Array In MATLAB
1 view (last 30 days)
Show older comments
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 Comments
Accepted Answer
Dyuman Joshi
on 27 Dec 2022
Edited: Dyuman Joshi
on 27 Dec 2022
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 Comments
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!