Re: Re: distance function
- To: mathgroup at smc.vnet.net
- Subject: [mg70133] Re: [mg70115] Re: distance function
- From: Carl Woll <carlw at wolfram.com>
- Date: Thu, 5 Oct 2006 03:32:24 -0400 (EDT)
- References: <200609300912.FAA13156@smc.vnet.net><efq680$2gf$1@smc.vnet.net> <200610040959.FAA07191@smc.vnet.net>
Ray Koopman wrote:
>Carl Woll wrote:
>
>
>>[...]
>>The package Statistics`ClusterAnalysis` has a very quick
>>DistanceMatrix function:
>>[...]
>>
>>
>
>The ClusterAnalysis.m file contains some usage messages
>for DistanceMatrix, but not the code. Where is the code?
>
>
Sometimes a package developer will code up a function in the kernel, and
then include just the usage message in the .m file. This is what occurs
here. The DistanceMatrix function can be accessed without loading the
package, as it already exists in the kernel. Try the following from a
fresh kernel (without loading Statistics`ClusterAnalysis`):
Quit
data = Table[ Random[], {3}, {2}];
Statistics`ClusterAnalysis`DistanceMatrix[data]
and you will get the distance matrix. If you load the package, then you
won't need to fully qualify the function name to use it. So, if you were
looking at the package to discover how someone could write Mathematica
code to create a distance matrix so quickly you will discover that they
"cheated", i.e., they coded the function within the kernel.
Carl Woll
Wolfram Research
- Follow-Ups:
- Re: Re: Re: distance function
- From: "Chris Chiasson" <chris@chiasson.name>
- Re: Re: Re: distance function
- References:
- Re: distance function
- From: "Ray Koopman" <koopman@sfu.ca>
- Re: distance function