Defining Mathematical "Mode" in Octave

View: New views
3 Messages — Rating Filter:   Alert me  

Defining Mathematical "Mode" in Octave

by DJBrewer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm a newbie at Octave, trying to work in a MATLAB program.

my first error message is 'mode' undefined, which means I need to define a function for finding the mathematical "mode" of a series of numbers (i.e., number that appears most often).  I'm struggling with finding the best way to do that.

Would it require counting the number of times a unique number appears, and keeping the unique number that appears the most? Or is there a simpler method?

Thanks

Defining Mathematical "Mode" in Octave

by John W. Eaton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On  6-Mar-2008, DJBrewer wrote:

| I'm a newbie at Octave, trying to work in a MATLAB program.
|
| my first error message is 'mode' undefined, which means I need to define a
| function for finding the mathematical "mode" of a series of numbers (i.e.,
| number that appears most often).  I'm struggling with finding the best way
| to do that.
|
| Would it require counting the number of times a unique number appears, and
| keeping the unique number that appears the most? Or is there a simpler
| method?

What version of Octave are you using?  The current stable release,
version 3.0.0, includes a mode function.

jwe
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Defining Mathematical "Mode" in Octave

by dastew :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

DJBrewer wrote:

> I'm a newbie at Octave, trying to work in a MATLAB program.
>
> my first error message is 'mode' undefined, which means I need to define a
> function for finding the mathematical "mode" of a series of numbers (i.e.,
> number that appears most often).  I'm struggling with finding the best way
> to do that.
>
> Would it require counting the number of times a unique number appears, and
> keeping the unique number that appears the most? Or is there a simpler
> method?
>
> Thanks
>  
mode works for me in 3.0.0
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave