Changing values in matrix under certain conditions

Hello! If I have a 30x1 matrix, and I would like to change the each values under certain condition in the matrix
For example
If vaule > 16, the vaule will be replaced into 1
else, the value will ve replaced into 0.
How can I do that? Please help!
Thanks a lot!

 채택된 답변

David Hill
David Hill 2022년 3월 2일
newMatrix=yourMatrix>16;

추가 답변 (0개)

카테고리

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

질문:

2022년 3월 2일

댓글:

2022년 3월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by