Re: IDL versus MATLAB : could you help me ????? [message #28367 is a reply to message #28135] |
Mon, 03 December 2001 00:13  |
Roy Edgar Hansen
Messages: 2 Registered: January 2001
|
Junior Member |
|
|
>
>> 4) IDL have keyword parameters, MatLab have not. This is really a clean way
>> of using variable
>> number of input parameters to functions, which maintain a high level of
>> readability.
>
> I'm not sure what you're referring to here, but MATLAB does let you pass
> in a variable number of inputs to a file, as well as produce a variable
> number of outputs. The VARARGIN and VARARGOUT keywords are used for
> this.
Well, in MatLab you must either keep track of the order of input parameters, or
you have
to parse the input manually (of type which is done in the plotting routines:
'XLim', [10,20] ).
Say you have a number of optional parameters, and only want to specify parameter
# N.
Either you have to specify all parameters before N, or parse the input yourself.
In IDL, the keyword parameter is named and any keyword parameter can be specified
regardless of all other input parameters, i.e. y = func( x,y, KEYW=14 ).
In my opinion, the keyword parameter functionality is a more readable way of
using variable
number of input parameters. The only alternative in MatLab is to parse the input
manually
(which of course can be done in IDL too).
-Roy
|
|
|