Loren on the Art of MATLAB

Results for: Efficiency

Delaying Evaluation of Function Inputs 8

Posted by Loren Shure,

Delaying Evaluation of Function Inputs  When you call a function in MATLAB, MATLAB first evaluates all the inputs, and then passes these (possibly) computed values as the inputs. Recently Ljubomir Josifovski asked if there was a way to... read more >>

A Brief History of polyval 4

Posted by Loren Shure,

A Brief History of polyval  When I first started working at MathWorks, there were already a few functions in MATLAB for working with polynomials. One of these, polyval, for polynomial evaluation, used one algorithm, based on Horner's... read more >>

More Ways to Find Matching Data 55

Posted by Loren Shure,

More Ways to Find Matching Data  Today on the newsgroup, a user wanted help finding when values in a matrix matched some other values (see the post). There was already a solution posted when I was reading, but something about this problem kept nagging at me. ... read more >>

Possible Test Scores 14

Posted by Loren Shure,

Possible Test Scores  Walter Roberson, frequent contributor to the MATLAB newsgroup, posed the following question to me to use as the starter idea of a blog. Q: Suppose there is a multiple-choice quiz,... read more >>

Timing Extraction of Parts of an Array 10

Posted by Loren Shure,

Timing Extraction of Parts of an Array  In Sarah's blog, Dan asked about speed of removing elements. There are a number of ways of deleting elements in MATLAB. So, what's the "best" way? ... read more >>

Finding Patterns in Arrays 19

Posted by Loren Shure,

Finding Patterns in Arrays  Recently, my colleague Jeff asked me if I would look at some code he wrote to find a pattern of numbers in a larger array. Without looking at his code, I asked... read more >>

Comparing repmat and bsxfun Performance 37

Posted by Loren Shure,

Comparing repmat and bsxfun Performance  I've been asked repeatedly about the performance comparison between two MATLAB functions, bsxfun and repmat. These two functions can each help with calculations in which two arrays are expected to have the same dimensions, but some ... read more >>

Speeding Up MATLAB Applications 26

Posted by Loren Shure,

Speeding Up MATLAB Applications  Today I’d like to introduce a guest blogger, Sarah Wait Zaranek, who is an application engineer here at The MathWorks. Today she talks about speeding up code from a customer to get acceptable ... read more >>

A Way to Automate “Regular” Renaming 17

Posted by Loren Shure,

A Way to Automate “Regular” Renaming  Recently someone at MathWorks asked me how he could automate the renaming of a bunch of M-files containing underscores ('_') in the names with derived names that removed the underscores and used camelCasing instead. You may have similar name manipulation operations... read more >>

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