Rank: 7 based on 1389 downloads (last 30 days) and 61 files submitted
photo

Jos (10584)

E-mail

Personal Profile:
Professional Interests:
neuroscience, physics, mathematics

 

Watch this Author's files

 

Files Posted by Jos (10584) View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
30 Jan 2012 GetKeyWait Wait a certain time for a single keypress (v2.1, jan 2012). Author: Jos (10584) keypress, kbhit, input, timed, getkey, pause 44 9
  • 4.83333
4.8 | 6 ratings
30 Jan 2012 getkey Get a single keypress (v1.3, jan 2012) Author: Jos (10584) keypress, get, getch, key, kbhit, input 124 22
  • 4.5
4.5 | 8 ratings
17 Jan 2012 KTHCOMBN K-th combination(s) of elements Author: Jos (10584) combinations, permutations, selection, statistics, matrix, combn 16 1
  • 5.0
5.0 | 1 rating
13 Jan 2012 ALLCOMB All combinations of input (v2.2, jan 2012) Author: Jos (10584) matrices, all, combination, permutation, cartesian product, select 169 24
  • 5.0
5.0 | 16 ratings
07 Oct 2011 PADCAT concatenate vectors with different lengths by padding with NaN (v1.2, oct 2011) Author: Jos (10584) matrix, matrices, matrix manipulation, cat, concatenate, add 36 3
  • 4.33333
4.3 | 4 ratings
Comments and Ratings by Jos (10584) View all
Updated File Comments Rating
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

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.

02 Feb 2012 Shuffle Numbers Shuffles numbers in a given matrix or vector Author: Aamir Alaud-din

This functionality has been around on the File Exchange for years. For instance, you might take a look at my RANDSWAP function
http://www.mathworks.nl/matlabcentral/fileexchange/12621-randswap

or RANDMAT by Peter Bodin
http://www.mathworks.nl/matlabcentral/fileexchange/7203-randmat

Here is the rather trivial one-liner for shuffling any array X (numbers, ND, cell, string, whatever):

X(randperm(numel(X)) = X ;

which maintains everything, except the order!

Your help section is pretty good; I'd suggest you try to follow ML standards, e.g., by creatin a proper H1 line, and example, and a See Also section (take a look at the help of any of the main ML functions)

30 Jan 2012 getkey Get a single keypress (v1.3, jan 2012) Author: Jos (10584)

@Andrew B: Thanks! I've implemented most of your suggestions. A new version should be up soon.
The "position" problem (if any) is, however, not easy to solve, as it seems to depend on OS, display setup, ML version ...

13 Jan 2012 ALLCOMB All combinations of input (v2.2, jan 2012) Author: Jos (10584)

Thanks Edward, a small glitch on my side ... fixed in version 2.2

09 Aug 2011 COMBN (4.2) All combinations of N elements taken from the vector V. Author: Jos (10584)

@ Talaria, this is impossible as it would require a memory of (at least) 150*(2^150) bits which is about 2700000000000000000000000000000000 Terabyte ...

However, it is unlikely that you need all those combinations at once; perhaps you can think of another approach to your problem, for instance, by drawing a few random combinations at a time?

Comments and Ratings on Jos (10584)'s Files View all
Updated File Comment by Comments Rating
30 Jan 2012 getkey Get a single keypress (v1.3, jan 2012) Author: Jos (10584) Jos (10584)

@Andrew B: Thanks! I've implemented most of your suggestions. A new version should be up soon.
The "position" problem (if any) is, however, not easy to solve, as it seems to depend on OS, display setup, ML version ...

25 Jan 2012 getkey Get a single keypress (v1.3, jan 2012) Author: Jos (10584) Bytheway, Andrew

Great work.

I made a few tweaks which you may be interested in implementing.

I added the following properties to the figure:
'NumberTitle','off'
'position',[0 -40 1 1]
'Name','Press a key'

On Windows this places the figure off of the screen, instead of behind the taskbar. This will help ensure that the figure is not visible since some users may place their taskbar elsewhere on the screen.

It is also possible for the user to maximize the figure and then close it, which would cause an error when attempting to delete the figure handle. To procect against this use the following code:

if ishandle(fh)
    delete(fh) ;
end

15 Jan 2012 KTHCOMBN K-th combination(s) of elements Author: Jos (10584) Manu

love it! I have been using combn a lot but this time I really needed something which can give me the kth combination without storing the whole big matrix. This is perfect.

13 Jan 2012 ALLCOMB All combinations of input (v2.2, jan 2012) Author: Jos (10584) Jos (10584)

Thanks Edward, a small glitch on my side ... fixed in version 2.2

11 Jan 2012 ALLCOMB All combinations of input (v2.2, jan 2012) Author: Jos (10584) Sciberras, Edward

Jos, I think you're missing a semicolon in line 60 for ischar(argn). Results in 0 being printed in the terminal without this.

Top Tags Applied by Jos (10584)
matrices, matrix, rand, statistics, probability
Files Tagged by Jos (10584) View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
01 Feb 2012 Shuffle Numbers Shuffles numbers in a given matrix or vector Author: Aamir Alaud-din statistics, finance, mathematics, rand, shuffle, randomization 12 1
30 Jan 2012 GetKeyWait Wait a certain time for a single keypress (v2.1, jan 2012). Author: Jos (10584) keypress, kbhit, input, timed, getkey, pause 44 9
  • 4.83333
4.8 | 6 ratings
30 Jan 2012 getkey Get a single keypress (v1.3, jan 2012) Author: Jos (10584) keypress, get, getch, key, kbhit, input 124 22
  • 4.5
4.5 | 8 ratings
17 Jan 2012 KTHCOMBN K-th combination(s) of elements Author: Jos (10584) combinations, permutations, selection, statistics, matrix, combn 16 1
  • 5.0
5.0 | 1 rating
13 Jan 2012 ALLCOMB All combinations of input (v2.2, jan 2012) Author: Jos (10584) matrices, all, combination, permutation, cartesian product, select 169 24
  • 5.0
5.0 | 16 ratings

Contact us at files@mathworks.com