octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Default arguments


From: Søren Hauberg
Subject: Re: Default arguments
Date: Fri, 15 Dec 2006 09:21:42 +0100
User-agent: Thunderbird 1.5.0.8 (X11/20061115)

Andreas Romeyke skrev:
Do you have a good example where defaults really useful?
In the "imshow" function your can specify a viewing range (i.e. tell the function that a pixel value of 0 equals to black, and 100 equals white).

The default is to let 0 equal black, and 255 white, but at times you want to change this. If "imshow" didn't have default arguments, I would have to write
  imshow(im, [0, 255])
a lot of times, which would make me go insane (some might argue, that it's too late...). Since imshow supports default arguments I just write
  imshow(im)
which is a lot easier to read (IMHO).

Søren


reply via email to

[Prev in Thread] Current Thread [Next in Thread]