Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Optimization of functions delivered by MATLAB
Date: Wed, 8 Aug 2007 08:55:45 +0000 (UTC)
Organization: Universit&#228;t Stuttgart
Lines: 30
Message-ID: <f9c0eh$rft$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-01-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1186563345 28157 172.30.248.36 (8 Aug 2007 08:55:45 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 8 Aug 2007 08:55:45 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 545430
Xref: news.mathworks.com comp.soft-sys.matlab:422891



Hi!

Occasionally I look into m-functions which are shipped with
Matlab and which are extremely often called in my code.
Often I find huge space for improvement. Let me give an
example with the function tripuls of the signal processing
toolbox (I don't know if I am allowed to post the code
here). It takes up to three arguments, but I never use the
third one. Anyway, the default parameter value is used in
the computations, causing unnecessary divisions and more. I
have written the following replacement which is much faster
when not using the third input argument: 

error(nargchk(1,3,nargin));
if nargin < 2
  y = max(0, 1-2*abs(t));
elseif nargin < 3
  y = max(0, 1-2*abs(t)/Tw);
else
  y = tripuls(t, Tw, skew);
end

Ok, let me get to the point. Are there people at The
Mathworks involved with skimming through all files, looking
for possible optimizations in order to speed up Matlab a
little bit from one release to another? If not, would The
Mathworks pay me for doing this as a freelancer? :-)

Regards
Markus