Replace 'greater than' values in a matrix

127 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Andrei Bobrov
Andrei Bobrov il 2 Mag 2012
M - your matrix
M(M > a) = b;

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by