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!