File Exchange Pick of the Week

August 3rd, 2005

Will code for food (or free)

Everyone,

I want to say hello to all of our new visitors that heard about us from the article in Design News

I am going to try something different this week: I want to hear from you.

I have been thinking about my Pick Of The Week from a few weeks ago that had to do with formatting of code. There are some great white papers out there that talk about coding styles like this one from Richard Johnson

What I would like to see is all of you MATLAB users out there to send me up to five tips, tricks or techniques that you think other people would benefit from seeing. This exercise will be different from the other guides because I want it to be written in CELL MODE publishing format by hundereds of people. You can get a demo of that by executing this command in MATLAB R14.

playbackdemo('PublishingfromtheEditor_viewlet_swf')

Each tip should look something like this:

dHull1.m

%% Use numel(x) not prod(size(x))
% It is more clear and efficient to use numel(x) than prod(size(x))
% when trying to find the number of elements in a matrix.
% Tip by Doug Hull

x = [1 2 3; 4 5 6];
numel(x)
prod(size(x))

Notice the headline is descriptive, the commentary tells a little bit more and there is some executable code that works. Brief tips are the best. Be creative so that we compile lots of different ideas.

I am very curious what kind of tips come out of this. I will compile the best of the tips into one big file and post it to the file exchange. Editing will begin on August 18th. Because of the large number of tips I expect to get, I will not be responding to individual e-mails.

To make it easier to sort through all these e-mails, could you please use the following conventions:

To: hull@mathworks.com
Subject: POTW TIP

Send the tips as attachments, use this naming scheme:
[’First initial’ ‘Last name’ Number ‘.m’]
for example dHull1.m

Comments are closed.


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.