Hello, I would like a function that:
example A=[100,16; 5,10]
I would like to make a function f with a threshold=15 such that f(A)=[100,16;0,0]
i.e. all the number below threshold become zero
Any idea? Thank you!

 채택된 답변

Sean de Wolski
Sean de Wolski 2013년 5월 1일

5 개 추천

A(A<15) = 0;
Use logical indexing.

댓글 수: 2

Tiger
Tiger 2013년 5월 1일
Thank you, Sean! Your reply is so fast
Milena Telecka
Milena Telecka 2020년 4월 22일
Great!

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

추가 답변 (0개)

질문:

2013년 5월 1일

댓글:

2020년 4월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by