unoise (Uniform Noise)

Ok, this is somewhat trivial. But how many times have people written asking for unoise(0,1)? And how many times have I coded this myself?

Function unoise(a,b)                        // random draws from a uniform distribution between a and b
    variable a,b
    return a+(enoise(0.5)+0.5)*(b-a)
End
Actually, this is not so trivial. This is the correct approach but will give you unoise in the range [a, b). This is because enoise(num) gives noise in the range [-num, num)

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More