removing specific column based on some condition

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.

 채택된 답변

Matt J
Matt J 2021년 4월 11일
편집: Matt J 2021년 4월 11일

0 개 추천

s=sum(A,1);
A(:, s<1000 | s>100000)=[];

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

릴리스

R2014a

질문:

2021년 4월 11일

댓글:

2021년 4월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by