Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
kmeans gives error msg.

Subject: kmeans gives error msg.

From: Sameet Sreenivasan

Date: 14 Jul, 2009 16:07:19

Message: 1 of 7

When i try to use kmeans clustering, no matter what the typsetting of the data, I get the following error msg:

??? Undefined function or method 'kmeans' for input arguments of type 'double'.



Here is an example :
>> A = [3 4; 5 6; 7 8 ; 10 11]

A =

     3 4
     5 6
     7 8
    10 11

>> kmeans(A)
??? Undefined function or method 'kmeans' for input arguments of type 'double'.

>>


I also checked that I have the kmeans function in my toolbox, so I don't know what's going on . Please help..

Sam

Subject: kmeans gives error msg.

From: Tom Lane

Date: 16 Jul, 2009 18:50:50

Message: 2 of 7

> ??? Undefined function or method 'kmeans' for input arguments of type
> 'double'.

Sam, this means you don't have the kmeans function. That would be true if
you don't have the Statistics Toolbox, or you have a very old version of it.
It would be in the toolbox/stats subdirectory of your MATLAB installation.
That directory would also have to be on your path.

-- Tom

Subject: kmeans gives error msg.

From: dpb

Date: 16 Jul, 2009 18:54:21

Message: 3 of 7

Tom Lane wrote:
>> ??? Undefined function or method 'kmeans' for input arguments of type
>> 'double'.
>
> Sam, this means you don't have the kmeans function. That would be true if
> you don't have the Statistics Toolbox, or you have a very old version of it.
> It would be in the toolbox/stats subdirectory of your MATLAB installation.
> That directory would also have to be on your path.
...

And "ver" from the command line would show what toolboxes are installed...

--

Subject: kmeans gives error msg.

From: James

Date: 13 Aug, 2009 23:54:19

Message: 4 of 7

dpb <none@non.net> wrote in message <h3nt7f$lr4$1@news.eternal-september.org>...
> Tom Lane wrote:
> >> ??? Undefined function or method 'kmeans' for input arguments of type
> >> 'double'.
> >
> > Sam, this means you don't have the kmeans function. That would be true if
> > you don't have the Statistics Toolbox, or you have a very old version of it.
> > It would be in the toolbox/stats subdirectory of your MATLAB installation.
> > That directory would also have to be on your path.
> ...
>
> And "ver" from the command line would show what toolboxes are installed...
>
> --

I get the same error: ??? Undefined function or method 'kmeans' for input arguments of type 'double'.

I have the toolbox and the path is set correctly: Here's what ver returns
-------------------------------------------------------------------------------------
MATLAB Version 7.9.0.3470 (R2009b)
MATLAB License Number: Prerelease
Operating System: Mac OS X Version: 10.6 Build: 10A402a
Java VM Version: Java 1.6.0_15-b02-213 with Apple Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------
MATLAB Version 7.9 (R2009b Prerelease)
Netlab Toolbox Version 3.3.1
Statistical Graphics Toolbox Version 1.2
Statistics Toolbox Version 7.1 (R2009a)
Symbolic Math Toolbox Version 5.3 (R2009b Prerelease)

I copied the toolbox from my other linux machine into my Mac. Could that be the problem. Please help! I really need to use some of the toolbox's methods
James

Subject: kmeans gives error msg.

From: James

Date: 13 Aug, 2009 23:58:02

Message: 5 of 7

dpb <none@non.net> wrote in message <h3nt7f$lr4$1@news.eternal-september.org>...
> Tom Lane wrote:
> >> ??? Undefined function or method 'kmeans' for input arguments of type
> >> 'double'.
> >
> > Sam, this means you don't have the kmeans function. That would be true if
> > you don't have the Statistics Toolbox, or you have a very old version of it.
> > It would be in the toolbox/stats subdirectory of your MATLAB installation.
> > That directory would also have to be on your path.
> ...
>
> And "ver" from the command line would show what toolboxes are installed...
>
> --

I get the same error: ??? Undefined function or method 'kmeans' for input arguments of type 'double'.

I have the toolbox and the path is set correctly: Here's what ver returns
-------------------------------------------------------------------------------------
MATLAB Version 7.9.0.3470 (R2009b)
MATLAB License Number: Prerelease
Operating System: Mac OS X Version: 10.6 Build: 10A402a
Java VM Version: Java 1.6.0_15-b02-213 with Apple Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------
MATLAB Version 7.9 (R2009b Prerelease)
Netlab Toolbox Version 3.3.1
Statistical Graphics Toolbox Version 1.2
Statistics Toolbox Version 7.1 (R2009a)
Symbolic Math Toolbox Version 5.3 (R2009b Prerelease)

I copied the toolbox from my other linux machine into my Mac. Could that be the problem. Please help! I really need to use some of the toolbox's methods
James

Subject: kmeans gives error msg.

From: dpb

Date: 14 Aug, 2009 00:08:24

Message: 6 of 7

James wrote:
...
> I copied the toolbox from my other linux machine into my Mac. Could
> that be the problem. Please help! I really need to use some of the
> toolbox's methods

Well, you can't use toolboxes you don't have valid licenses for--the
license from the linux box isn't good for the Mac. Either run on the
other box or upgrade your Mac installation.

--

Subject: kmeans gives error msg.

From: Tom Lane

Date: 14 Aug, 2009 15:49:58

Message: 7 of 7

> I get the same error: ??? Undefined function or method 'kmeans' for input
> arguments of type 'double'.
>
> I have the toolbox and the path is set correctly: Here's what ver returns

James, I would look in the toolbox directory:

  cd(matlabroot)
  cd toolbox/stats
  dir kmeans.m

If it's not there, that's the problem. If it is there, try

  rehash toolbox

-- Tom

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us