Borrar filtros
Borrar filtros

Replace 'greater than' values in a matrix

97 visualizaciones (últimos 30 días)
Corey Bullard
Corey Bullard el 2 de Mayo de 2012
Comentada: ahmed ALmarhabi el 27 de Feb. de 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?

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 2 de Mayo de 2012
M - your matrix
M(M > a) = b;

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by