idl versus matlab [message #37053] |
Thu, 20 November 2003 08:51  |
Gareth Mottram - RSG
Messages: 3 Registered: June 2003
|
Junior Member |
|
|
I have to admit this is a slightly frivolous post, but here goes.
A guy in my office insists that matlab is better for multivariate stats
in image analysis than IDL, I doubt whether this is correct but I don't
have any examples to prove him wrong, or indeed to prove me wrong.
Anyone out there have opinions/comments/examples?
g
--
Gareth N. Mottram
Support Officer
Remote Sensing Data Analysis Service
Plymouth Marine Laboratory
Prospect Place
Plymouth
Devon, PL1 3DH
UK
Tel : ++44 (0)1752 633485
Fax : ++44 (0)1752 633101
E-mail: gnmo@pml.ac.uk
Web : http://www.npm.ac.uk/rsdas/
Registered Charity No. 1091222
Company No. 4178503
|
|
|
Re: idl versus matlab [message #37109 is a reply to message #37053] |
Fri, 21 November 2003 10:17  |
George N. White III
Messages: 56 Registered: September 2000
|
Member |
|
|
On Thu, 20 Nov 2003, Gareth Mottram - RSG wrote:
> I have to admit this is a slightly frivolous post, but here goes.
> A guy in my office insists that matlab is better for multivariate stats
> in image analysis than IDL, I doubt whether this is correct but I don't
> have any examples to prove him wrong, or indeed to prove me wrong.
>
> Anyone out there have opinions/comments/examples?
Matlab pales in comparison to J and APL for elegance.
The S language (e.g., R) is nice for stats. One factor that makes S so
nice to use is the well-designed support for missing data. In addition to
the usual IEEE NaN and Inf values, there is 'NA':
> x<-c(0:4,NA) ; 1/x
[1] Inf 1.0000000 0.5000000 0.3333333 0.2500000 NA
> c(mean (1/x), mean (1/x,na.rm=T))
[1] NA Inf
> x[1]<-NA ; c(mean (1/x), mean (1/x,na.rm=T))
[1] NA 0.5208333
'NA' is implemented using distinguished values. Every operation has to
test for these values. That is a lot of overhead if you don't need it. It
is, however, a huge time-saver if the alternative requires you to type
'where(...)' dozens of times (especially if you are like me and have to
think a few minutes to remember whether you are supposed to use 'A lt B'
or 'A .lt. B' or 'A < B'). Some people try to use NaN/Inf for this, but
the overhead for NaN/Inf processing is typically much higher, and you can
miss problems like logs of negatives in your code.
--
George N. White III <aa056@chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia, Canada
|
|
|