Rank: 7563 based on 5 downloads (last 30 days) and 1 file submitted
photo

Mitchell Olson

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by Mitchell Olson
Updated   File Tags Downloads
(last 30 days)
Comments Rating
06 Feb 2012 Average and remove duplicates from a matrix This function averages out duplicate values in a matrix and removes the duplicates Author: Mitchell Olson duplicate, data processing 5 3
  • 3.5
3.5 | 2 ratings
Comments and Ratings on Mitchell Olson's Files View all
Updated File Comment by Comments Rating
01 May 2012 Average and remove duplicates from a matrix This function averages out duplicate values in a matrix and removes the duplicates Author: Mitchell Olson John D'Errico

01 May 2012 Average and remove duplicates from a matrix This function averages out duplicate values in a matrix and removes the duplicates Author: Mitchell Olson John D'Errico

Incredibly slow.

X = round(rand(1e6,1)*10000);

tic,avg_dup(X);toc
Elapsed time is 58.442939 seconds.

tic,consolidator(X);toc
Elapsed time is 0.609666 seconds.

And it is not terribly useful, since it

1. Looks for exact replicates, with no capability for a tolerance.

2. Allows the capability to average only. If you want to compute instead the sum, or max, min, harmonic mean, median, geometric mean, standard deviation, etc., you are out of luck.

There is no H1 line, merely a statement of the author's name and e-mail address. That means the lookfor tool is disabled when you forget what the name of this tool is next year.

I'd suggest a tool that offers everything this does and far more, allowing you to compute any aggregative measure, has better help, an H1 line, and is seriously faster.

http://www.mathworks.com/matlabcentral/fileexchange/8354-consolidator

01 May 2012 Average and remove duplicates from a matrix This function averages out duplicate values in a matrix and removes the duplicates Author: Mitchell Olson rasam aliazizi

Thank you, this is exctly what i was looking for.

08 Feb 2012 Average and remove duplicates from a matrix This function averages out duplicate values in a matrix and removes the duplicates Author: Mitchell Olson Jos (10584)

This might be useful to some. However, you should a look at accumarray:

[u,i,j] = unique(A(:,1)) ;
A_avg_dup = [j, accumarray(j,A(:,2),[],@mean)] ;

In addition, you might revise your help section, so that it mimics ML standards (H1 line, used by LOOKFOR, a SEE ALSO line). Take a look at the help of any basic ML function for some inspiration.

Contact us