File Exchange Pick of the Week

LazyWeb: Closed challenges

Lazy web is a concept where you put requests out and see if anyone else has made the code you are looking for, or might be looking for that little push to start working together on that code. Send me a concise description of a function you would like to see written for MATLAB. Better yet, donate the code that is requested by people. See the open and closed challenges pages for examples.
CHALLENGE 1 Dear LazyWeb, I would like to have a function like this: —– function makeLineHighlightable(h) MAKELINEHIGHLIGHTABLE Highlight a line when clicked on. h can a vector of line handles, or an axes handle. MAKELINEHIGHLIGHTABLE will set a buttondownfcn callback on the line(s) (or all lines in the axes) such that when you click on it the line width will go up a couple of points so it is easier to see. Clicking on a highlighted line, will cause it to go back to normal. Clicking on a non-highlighted line will cause any other highlighted lines in the axes to go back to normal. Thanks! Doug SOLUTION 1 MakeLineHighlightable by Matthew
CHALLENGE 2 Dear LazyWeb, I would like a hand ranker for poker hands of 2-7 cards. The input format can be anything, from a binary matrix representing the cards chosen from a 52 card deck, to a list of the cards (ie. 1, 23, 52). The function would need to take either a single hand, or a set of hands and output an absolute rank of all possible hands, so a royal flush would be rank 1, and [2 3 4 5 7] of different suits would be the absolute worst hand (maybe rank 23,456,421,356). The program should be able to look at a seven card hand and find the ranks of all of the five card hands that are possible from it (same with two card hands, etc). This should, of course, be lightning fast. If it makes it easier, the ranks do not have to be continuous (ie. There might not be a hand with rank 34 for some reason, so long as the output is easily comparable to one another. Maybe you have a vector that had five values [1 for straight flush, 2 for four of a kind, etc…, the second value would give the tie breaker within the first rank like 1 for Quad Aces, 2 for Quad kings], there would be as many tie breakers as need until each hand was unambiguously ranked). Should be able to get a word description of the hand also, “Pair of twos with an Ace, Jack, Five kicker” Thanks, Doug SOLUTION 2 Poker hand ranker by Rob
CHALLENGE 3 Dear LazyWeb: I really like the paper “The End of the Rainbow? Color Schemes for Improved Data Graphics” by A. Light and P.J. Bartlein (see http://geography.uoregon.edu/datagraphics/EOS/Light&Bartlein_EOS2004.pdf). In it, the authors describe some pitfalls of colormap design, and then they provide some nice example colormaps of well-designed colormaps. Please make me a file that creates the five colormaps shown in Figure 2. Each colormap should take an input that will let me make it arbitrarily long (just like HSV or GRAY in the MATLAB toolbox). Naming colormaps is tricky. Maybe you can give them names like DivergingRedBlue or SingleHuePurple. Thanks, Ned SOLUTION 3 Movie and MakeColorMap by Doug and Light Bartlein Color Maps by Robert

Bob, Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

  • oleg: The author has implemented skewness, kurtosis and checks answering appropriately to the critic.
  • Ashok: how to store 10 or more random number in a loop a loop for i = 1:n mean(i) = input(’enter the mean value...
  • Ben: Doug, Thanks for the very helpful videos! Uitables seem like a convenient way to make a customized property...
  • oleg: Allstats has no checks, no comments and could also be improved (talking about prctile implementatio). Not to...
  • Todd: Additional information and a link to download free MATLAB and Simulink LEGO MINDSTORMS NXT code can be found at...
  • Doug: @Leo, Here is the “English version” of that code. “vec = []” makes an empty variable...
  • leo: Dear Doug I have a question in your code ‘October 9th, 2009 at 13:53′ vec = []; vec = [vec val]; I...
  • Shanker Keshavdas: You sir, are a gentleman and a scholar… No really, helped me out a lot. As to what is...
  • Quan Zheng: how can I get a copy of stepspecs.m?
  • Doug: @Lucy I think this is what you seek to move a line with the mouse in MATLAB. http://blogs.math...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.