How to delete Multiple of any Value in Array In MATLAB
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Med Future
am 27 Dez. 2022
Kommentiert: Dyuman Joshi
am 27 Dez. 2022
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 Kommentare
Akzeptierte Antwort
Dyuman Joshi
am 27 Dez. 2022
Bearbeitet: Dyuman Joshi
am 27 Dez. 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!