File Exchange Pick of the Week

November 13th, 2007

LazyWeb on the File Exchange

In a recent post, I showed how Roger did a mash-up of two prior Picks. In the video, I actually made a request that someone make some further modifications to the code. This concept of asking other people to do software development tasks for you is often called “LazyWeb”.

We think it would be fun to have a page where people describe functions that they wish existed on the File Exchange. In other words, ask everybody on the web to make you something, and somebody might just do it. The key is to make a very clear and reasonable request. Leave a comment on this post if you can describe functionality that you’d like someone else to write for you. I’ll put that information on my blog, and if someone actually writes the program that you describe, I’ll mention it here and send that person a MATLAB t-shirt.

The requests and results have been moved to more static pages here:
Open Challenges
Closed Challenges

14 Responses to “LazyWeb on the File Exchange”

  1. Doug replied on :

    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

    PS Get a MATLAB t-shirt and be Pick of the Week if you write this well.

  2. Doug replied on :

    Dear LazyWeb,

    I would like about twenty nice icons in a collection that would be appropriate for shortcuts in the MATLAB desktop. These icons should be useful in a variety of situations, maybe
    * Generic plot
    * Big red X
    * Black Box
    * Skull and cross bones
    * Arrows

    These would have a variety of colors and graphics. It would make it easier to keep all of the shortcuts straight and allow for fewer words in the shortcut description.

    Thanks!
    Doug

  3. Doug replied on :

    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

  4. Matt Whitaker replied on :

    Ok Doug,
    I bit. Just submitted makeLineHighlightable. Although just realized you wanted all the other lines to turn off. I resubmit with that feature.
    Matt

  5. Doug replied on :

    Matt,

    Thank you! This file was created faster than I would have ever guessed (three hours). I have already made use of this in a project I was working on. Here is the link to the file Matt made.

    http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=17505&objectType=FILE

    I will work up a blog post about it soon, and Helen will be in touch to get you the promised MATLAB t-shirt and other goodies!

    Doug

  6. Ned Gulley replied on :

    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

  7. Urs (us) Schwarz replied on :

    doug
    i REALLY hope you are NOT serious about this…
    urs

  8. Doug replied on :

    Urs,

    Why do you hope that?

    I am always looking for suggestions for more videos http://blogs.mathworks.com/pick/category/video/ to make, or code to write to help out MATLAB users. You have an impressively long list of contributions to the File Exchange http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectType=author&objectId=10786
    I can only assume that some of those came about from discussions from other MATLAB users.

    Doug

  9. Matt Whitaker replied on :

    Why not, Urs
    I see it this way:
    1) Poorly described problems are unlikely to get a response.
    2) Overly complex problems are unlikely to get a response unless the issue is of great interest to someone in which case it may provide them with the motivation to write the code. Usually a well worded problem description is exactly what you need to get started.
    3) It may start collaborations between individuals who did not realize they had common problems/interests.

    I wrote the submission earlier because I have a lot of similar code and this particular bit of code may come in handy. I wouldn’t look at the poker hand problem because I know nothing about poker but Ned Gully’s post led to an interesting article and I might think about that at some point.

    More interaction is hardly ever a bad idea.

  10. Rich Quist replied on :

    Sounds like a fabulous idea. My “Fill Page” File Exchange submission http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=16566&objectType=FILE was inspired by a blog entry I came across one day…

    Sometimes people don’t realize that some code they’ve already written (or know how to easily write) can be useful in solving a more general problem.

  11. DanK replied on :

    Dear Lazyweb,
    What I would love is a one function that could be called in one line, which does nothing if the program is being run in MatLab, but only when it is running in deployed mode. The reason for this is I have a bunch of routines where I often want to run them multiple times, without having to launch the exe each time. So I would like the wrapper function to pop up a small dialog that asks the user: “Do you want to run the function {name of function routine was called from} or exit?” and have two buttons. If the user clicks the run button, it should be just as if the original function was run by launching the (unaltered) .exe. The dialog then goes dormant until the program is finished running, at which point it regains focus and asks: “Run again?” When the exit button is clicked, all the windows get closed, and the executable shuts down. This would be very useful to my co-workers who may have to run batches of data, that can’t be pre-determined. As a bonus, it would be very nice if this dialog has a string field and captures the output from a disp() command, instead of letting it go to the dos window.

    In my own defense, I have tried to achieve this and it only works, very so-so.

    Thanks if anybody wants to take this one up.

    Dan

  12. Rob replied on :

    Doug,

    OK, in response to your LazyWeb request above, I just submitted a “poker hand ranker” function to the file exchange. I’m not a big poker player, but solving games in ML is fun. I also must admit that the allure of a ML t-shirt is compelling.

    I did some basic range testing on the function (rankp.m) to make sure that the worst hand of one type (e.g. full house) will not score worse than the best hand of the next lowest type (e.g. flush). Tell me if it is what you were thinking of in the request.

    Best,
    Rob

  13. Dave replied on :

    DanK, are you still interested in a dialogue for running deployed programs in batch mode?

  14. J Lister replied on :

    Doug,

    Nice idea. I am trying to hack suptitle for this LazyWeb request myself, but if anyone else wants to take a stab at it, here goes…

    I need a function similar to suptitle, but what I really want is to add a visable header and footer to any plot that I make. It must accept multiple lines of text (a cell array) for both header and footer. It also must play well with the file exchange entry called addaxis and plots with multiple subplots.

    Thanks,
    Jonathan

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


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

  • Zach: Hi Doug and Les, I didn’t have a lot of time to mess with this, but I did find a work-around. I plotted...
  • hamed: k
  • Les: @Zach This isn’t exactly what you are looking for but at least it puts all three parameters on the same...
  • Zach: Thanks for your suggestions Doug. I’ll give that a shot and see what happens. I’ve seen many of...
  • Doug: @Zach, I would say to use plotYYY, because that is close to what you want, but using depth as Y makes sense....
  • Doug: @Teja, I think this will work: http://www.mathworks .com/access/helpdesk /help/techdoc/ref...
  • Gify: merry christmas :) nice christmas tree! Regards, Janet Gify
  • Teja: Dear Doug Is there anyway to plot a surface from nonuniform data without meshgrid and griddata? Basically i...
  • Zach: I’m working with geophysical data, so I’d like to produce a depth profile. The y-axis would be...
  • Doug: @Ashok First, please do not use variable names that are MATLAB commands (std and mean). Second, p(j) should be...

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