Replace 'greater than' values in a matrix

조회 수: 148 (최근 30일)
Corey Bullard
Corey Bullard 2012년 5월 2일
댓글: ahmed ALmarhabi 2021년 2월 27일
I want to look through a very large matrix and replace numbers that are larger than, say, a, with b.
Is there a simple way or a function to do this?

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 5월 2일
M - your matrix
M(M > a) = b;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by