Loren on the Art of MATLAB

Results for: Vectorization

MATLAB Behavior: for 34

Posted by Loren Shure,

MATLAB Behavior: for  Conventional wisdom for programming MATLAB used to be that using for loops automatically forced a program to suffer from poor performance. Since MATLAB R13 (version 6.5), MATLAB has taken advantage of some innovations... read more >>

Coordinating Zero Removals from Multiple Arrays 13

Posted by Loren Shure,

Coordinating Zero Removals from Multiple Arrays  I've fielded some questions recently about how to coordinate multiple arrays changing simultaneously. One example is removing elements for two arrays in the case where either array holds a zero for the... read more >>

Calculus with Empty Arrays 25

Posted by Loren Shure,

Calculus with Empty Arrays  MATLAB has had empty arrays since before I started using the program. When I started, the only size empty array was 0x0. When version 5 was released, empty arrays came along for the N-dimensional ride and got more shapely. ... 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 >>

Vectorizing the Notion of Colon (:) 14

Posted by Loren Shure,

Vectorizing the Notion of Colon (:)  The other day, one of my MathWorks buddies, Peter, asked me if I knew any tricks for vectorizing the notion of the colon (:) operator. For me, this sort of inquiry sometimes has an effect similar to waving a flag in... 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 >>

Structure Initialization 50

Posted by Loren Shure,

Structure Initialization  This post continues in the theme of other recent ones, questions frequently posed to me (and probably others). It has to do with initializing structures. There is a healthy set of... read more >>

Vectorizing Access to an Array of Structures 40

Posted by Loren Shure,

Vectorizing Access to an Array of Structures  Though I have written about this topic before, I continue to get questions on working with arrays of structures. So I thought I would focus on that alone today. ... read more >>

Creating Sparse Finite-Element Matrices in MATLAB 49

Posted by Loren Shure,

Creating Sparse Finite-Element Matrices in MATLAB  I'm pleased to introduce Tim Davis as this week's guest blogger. Tim is a professor at the University of Florida, and is the author or co-author of many of our sparse matrix functions... read more >>

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