Rank: 2282 based on 60 downloads (last 30 days) and 7 files submitted
photo

Mattias Karlsson

E-mail
Company/University
HHMI Janelia Farm

Personal Profile:

 

Watch this Author's files

 

Files Posted by Mattias Karlsson View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
05 Jun 2013 Screenshot MatClust Spike sorting program for extracellular recordings. Version 1.4 Author: Mattias Karlsson spike sorting, neuroscience, clustering 21 6
16 Jan 2013 findNlargest Finds the N largest values in the input. Very fast. Author: Mattias Karlsson optimization, mathematics, mex, fast 4 4
  • 4.0
4.0 | 2 ratings
08 Jan 2013 rowfind Finds rows of LOOKUPVALUES that are equal to rows in VALUES and return the index of the rows. Author: Mattias Karlsson optimization 5 0
07 Jan 2013 lookup This function will return the indices of a vector that are closest to the numbers in another. Author: Mattias Karlsson optimization, mathematics 11 0
07 Jan 2013 rowcount Counts the number of rows in LOOKUPVALUES that matches each row in VALUES and returns the counts. Author: Mattias Karlsson optimization 3 0
Comments and Ratings by Mattias Karlsson View all
Updated File Comments Rating
27 Sep 2013 MatClust Spike sorting program for extracellular recordings. Version 1.4 Author: Mattias Karlsson

Hi Laurens. This error happens if the c function were not compiled during install, or if they were not put in the matclust main directory. When you type 'matclustsetup', you should be in the matclust directory so that the compiles files are placed there. What was the output on the screen when you ran matclustsetup?

28 Jan 2013 Decimate Polygon Simplify a 2D closed, piecewise linear contour by specifying boundary offset tolerance. Author: Anton Semechko

Great function. It's nice that it is self contained too.

18 Jan 2013 findNlargest Finds the N largest values in the input. Very fast. Author: Mattias Karlsson

Bruno, I see that you have also written a very nice implementation for this purpose (mink and maxk). Again using your example with a million points, I find that if N is 1000, findNlargest runs about 2.5 times faster than maxk, but for larger N maxk is faster. If the poolsize is 5 million and N is 1000, findNlargest is over 7 times faster than maxk. So, users should be aware that this function is specialized for choosing a small number of values from a large pool. Otherwise maxk and mink will perform better in the general case.

18 Jan 2013 findNsmallest Finds the N smallest values in the input. Very fast. Author: Mattias Karlsson

As is discussed for findNlargest, this function is intended for cases when you are choosing a small number of values from a large pool. If you choose 5 values from a pool of a million, this function is about 40 times faster than if you sort.

18 Jan 2013 findNlargest Finds the N largest values in the input. Very fast. Author: Mattias Karlsson

Hi Bruno,
As far as retrieving the index goes, it seems to work fine when I do it:

a = rand(1,1e6);
[x,index] = findNlargest(a,5)

x =

1.0000
1.0000
1.0000
1.0000
1.0000

index =

878652
294446
965700
961872
165538

In this case, if there are more than 5 of the same max value, then the first 5 would be chosen.

And for the second point, yes, this code is intended for cases when you are choosing a small number of values from a large pool. In your example (with a pool of a million values), if N = 5, my code is about 40 times faster than sorting. If N = 1000, my code is 6 times faster. Once N is greater than half the sample size, it makes more sense to find the poolsize-N smallest values. (see findNsmallest).

Comments and Ratings on Mattias Karlsson's Files View all
Updated File Comment by Comments Rating
29 Sep 2013 MatClust Spike sorting program for extracellular recordings. Version 1.4 Author: Mattias Karlsson Laurens Witter

Hi Mattias, Thank you for the quick response. The first time I tried to compile it all seemed to work: No errors (but also no output, which I didn't realise should be there).
I finally solved the problem today. My SDK 7.1 had some problems and I had to deinstall and install some things. Anyway, MatClust is running. Thanks!

27 Sep 2013 MatClust Spike sorting program for extracellular recordings. Version 1.4 Author: Mattias Karlsson Mattias Karlsson

Hi Laurens. This error happens if the c function were not compiled during install, or if they were not put in the matclust main directory. When you type 'matclustsetup', you should be in the matclust directory so that the compiles files are placed there. What was the output on the screen when you ran matclustsetup?

27 Sep 2013 MatClust Spike sorting program for extracellular recordings. Version 1.4 Author: Mattias Karlsson Laurens Witter

I am looking for a nice clustercutting program and would like to use your submission. Install works fine, but when starting I get and error:

>> matclust
loading.There was a problem starting matclust. Error in figure1_fill.
Undefined function 'fastbitset' for input arguments of type 'int32'.

06 Feb 2013 findNsmallest Finds the N smallest values in the input. Very fast. Author: Mattias Karlsson lu li

It would be perfect if returned values are in sorted order.

18 Jan 2013 findNlargest Finds the N largest values in the input. Very fast. Author: Mattias Karlsson Bruno Luong

Ah sorry, I overlook the index part.

Contact us