Borrar filtros
Borrar filtros

removing specific column based on some condition

13 visualizaciones (últimos 30 días)
Mohammad Juned
Mohammad Juned el 11 de Abr. de 2021
Comentada: Mohammad Juned el 11 de Abr. de 2021
Hi all, I want to remove specific column from a matrix based on certain condition.
let A be a matrix of order 8*3
A=[20 150 1500; 30 400 375; 75 450 2000; 70 100 400; 45 2500 420; 150 480 300; 142,420,1700; 135, 450 420];
if sum of that column is less than 1000 or greater than 100000 then remove that column. how it can be done.

Respuesta aceptada

Matt J
Matt J el 11 de Abr. de 2021
Editada: Matt J el 11 de Abr. de 2021
s=sum(A,1);
A(:, s<1000 | s>100000)=[];

Más respuestas (0)

Categorías

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

Productos


Versión

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by