MATLAB: How to add uniform noise with given range

filter

I can't find any good documentation on adding uniform noise with a given range. Does anyone know how to do it? Or can someone point me in the right direction to figure it out.
Add uniform noise to an image with range [-0.05 to 0.05]

Best Answer

lower_bound = something
upper_bound = something
n = number of samples
u = lower_bound + rand(1,n)*(upper_bound-lower_bound);
This is the second example in the doc:
Related Question