Replace 'greater than' values in a matrix

109 Ansichten (letzte 30 Tage)
Corey Bullard
Corey Bullard am 2 Mai 2012
Kommentiert: ahmed ALmarhabi am 27 Feb. 2021
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?

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 2 Mai 2012
M - your matrix
M(M > a) = b;

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by