Matrix function for subtracting and adding numbers from values in a matrix
显示 更早的评论
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]
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!