Code covered by the BSD License  

Highlights from
iModa

4.5

4.5 | 2 ratings Rate this file 5 Downloads (last 30 days) File Size: 1.61 KB File ID: #6708
image thumbnail

iModa

by Isaac Mancero Mosquera

 

10 Jan 2005 (Updated 13 Jan 2005)

Find the statistical mode of vector of data.

| Watch this File

File Information
Description

A MATLAB script to find the mode of vector x. It is possible to perform a checksum on data and to plot the vector of frequencies just by uncommenting the right lines, use it in case it is possible to find more than one mode. Plot is optional.

Calling sentece: [Moda ncont] = iModa(x)
Developed under MATLAB(TM) version 7.0.0.19901 (R14) by Isaac M. M. INOGS, Trieste(Italy). January 10, 2005 @01h46:44.

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
12 Jan 2005 Jos jnvdg@arcor.de

or:
n = histc(x, unique(x)) ;
[MODE, FREQ] = max(n) ;

13 Jan 2005 Jos jnvdg@arcor.de

Sorry, too hasty:

uniqueX = unique(x) ;
n = histc(x,uniqueX) ;
[FREQ,mi] = max(n) ;
MODE = ua(mi) ;

13 Jan 2005 Isaac M. M.

Thank you, Jos; I've just included your suggestion.

13 Jan 2005 Isaac M.M.

Ok, I have just uploaded it, it will be available after 2 or 3 bussiness days...

14 Jan 2005 Isaac M. M.

Ok, the new version is ready to download, it includes suggestion from Jos, also some robustness regarding NANs (not-a-numbers) is added.

14 Jan 2005 Aqui yo

nice

22 Jul 2006 Muhammad Nadeem Rasheed

This is very good.And help me in my work.

Please login to add a comment or rating.
Updates
13 Jan 2005

Modified in order to include suggestion from Jos and add some robustness regarding NANs

Tag Activity for this File
Tag Applied By Date/Time
statistics Isaac Mancero Mosquera 22 Oct 2008 07:39:28
probability Isaac Mancero Mosquera 22 Oct 2008 07:39:28
moda estadistica Isaac Mancero Mosquera 22 Oct 2008 07:39:28
statistical mode Isaac Mancero Mosquera 22 Oct 2008 07:39:28
mode Isaac Mancero Mosquera 16 Jun 2011 10:50:38

Contact us at files@mathworks.com