Replace 'greater than' values in a matrix

97 次查看(过去 30 天)
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