Reputation: 4640
I have attached a sample image with explains the requirement.
I have a 16x16 matrix or random values (1-1000) generated by randi(1000, 16, 16)
Now I add a 4x4 matrix of same number (eg. 80) somewhere in the 16x16 matrix.
How to I make the large numbers (1-1000) to deviate to my new block of 80s so that the values near 4x4 bock have values closer to 80?
PS. 500 near the small matrix should have been ~100 (my mistake)
Upvotes: 2
Views: 418
Reputation: 21563
You can apply a weighted average.
x
and take 80
.80
is 1
and the weight of x
is 0
.80
and the larger the weight of x
.Upvotes: 1