Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to be a good Matlab programmer
Date: Sun, 20 Apr 2008 22:40:11 -0400
Organization: The MathWorks, Inc.
Lines: 50
Message-ID: <fuguqb$gqk$1@fred.mathworks.com>
References: <d6f9728b-07d7-4ebc-8264-e2485cde6259@c65g2000hsa.googlegroups.com> 	<fudv0j$adm$2@aioe.org> <b375ae00-dba3-42a5-a138-31be2142591c@s50g2000hsb.googlegroups.com> <u8xOj.1371$26.1046@newssvr23.news.prodigy.net>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1208745611 17236 144.212.105.187 (21 Apr 2008 02:40:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 21 Apr 2008 02:40:11 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
Xref: news.mathworks.com comp.soft-sys.matlab:464214




"Dave Bell" <dbell@TheSPAMFREEBells.net> wrote in message 
news:u8xOj.1371$26.1046@newssvr23.news.prodigy.net...
> Rex wrote:
>> On Apr 19, 7:23 pm, dpb <n...@non.net> wrote:
>
>>> I assume you've read the section in the online documentation on
>>> "Optimizing Matlab Code" in the m-file programming section?
>>>
>>> --
>>
>> Yes, I have; that is the type of resource I am looking for. However, I
>> want to be clear that I'm not just looking for tips on optimizing the
>> performance of my code;  I also want to learn to write more elegant
>> and concise code.
>> Rex
>
> That was a good example of what I encountered as a new Matlab user, as 
> well. It's an entirely different programming paradigm, and it takes a 
> while to get used to. (I still program Matlab like C!)
>
> Another issue I ran into was simply searching for help. When I was trying 
> to speed up a project I was working on, someone suggested using benchmark 
> before and after changing some code. Not wanting to seem dumber than I 
> was, I didn't ask how to benchmark my code, I just figure I'd look it up. 
> Try it - there is no such command. One of the two hits I got from 'Help 
> benchmark' was an article on training a neural net, the other was about a 
> Simulink model of a Physics 1 experiment with a cart and mass. I won't 
> admit to how long it took to find 'bench'!

Actually, I think what you want is the Profiler:

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f9-17018.html

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/profile.html

If you encounter a situation like this in the future, where searching the 
documentation or the website using your keyworks doesn't find the 
information you want, please let our documentation staff know what you 
searched for and what you expected to find with those keywords.  On most if 
not all of the documentation pages on the website, there's a link in the 
upper-right corner of the frame showing the doc page that allows you to 
provide feedback.  This will let our documentation staff make it easier to 
find that information.

-- 
Steve Lord
slord@mathworks.com