Borrar filtros
Borrar filtros

How to delete Multiple of any Value in Array In MATLAB

3 visualizaciones (últimos 30 días)
Med Future
Med Future el 27 de Dic. de 2022
Comentada: Dyuman Joshi el 27 de Dic. de 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.

Respuesta aceptada

Dyuman Joshi
Dyuman Joshi el 27 de Dic. de 2022
Editada: Dyuman Joshi el 27 de Dic. de 2022
y=load('multiple.mat').Value;
%all the different value present in the array
z=unique(y)
z = 1×6
35 40 45 50 55 70
for j=unique(y)
y( (rem(y,j)==0) & y~=j )=[];
end
y
y = 1×1410
35 35 35 35 35 35 35 40 45 50 55 35 35 35 35 35 35 35 35 35 35 40 45 50 55 35 35 35 35 35
  5 comentarios
Med Future
Med Future el 27 de Dic. de 2022
@Dyuman Joshi I want to delete those values in array, which are multiple of any value present in array.
Dyuman Joshi
Dyuman Joshi el 27 de Dic. de 2022
I have edited my answer, please take a look at it again.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by