selection from matrix with condition

Hi to all, actually i m having a matrix X=250*10 from which i want to choose the colomns that have an average >0.1 and a standard diviation >0.2 and put them in a new matrix 250*k ((where k depends on the colomns that satisfy the 2 (between 0 and 10)) Thank you in advance for your help with this
best regards

 채택된 답변

Image Analyst
Image Analyst 2012년 12월 6일

0 개 추천

How about this:
stdX = std(X, 1)
meanX = mean(X, 1);
meetCriteria = meanX > 0.1 & stdX > 0.2
out = X(:, meetCriteria);

댓글 수: 2

Image Analyst
Image Analyst 2012년 12월 6일
Hopefully this wasn't your homework!!!
Dam
Dam 2012년 12월 6일
Thank you for your answer it s not my homework i m learning matlab alone so this question could be very easy for you but for me it s not :) Thank you once more Dima

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Matt J
Matt J 2012년 12월 6일

0 개 추천

X(:,std(X)<=.2 | mean(X)<=0.1)=[];

댓글 수: 2

Dam
Dam 2012년 12월 6일
Thank you for your answer, the second answer works better
Best regards
Matt J
Matt J 2012년 12월 6일
편집: Matt J 2012년 12월 7일
I can't see how you would have gotten different results, be they better or worse.

댓글을 달려면 로그인하십시오.

카테고리

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

태그

질문:

Dam
2012년 12월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by