Hi! When i use 'speckle' param in imnoise, i got error: Undefined variable "d". How i can see, you don't initialise "d" in this case.