Matrix function for subtracting and adding numbers from values in a matrix
Afficher commentaires plus anciens
I am trying to make a function that focuses on a matrix. I want the function to subtract 4 from any number in the matrix > 4, and then add 1 to each surrounding number in the matrix, until all numbers are < 4
If the matrix = [0 0 0;0 9 0; 0 0 0]
I want it to change to [0 2 0;2 1 2;0 2 0]
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!