Loren on the Art of MATLAB

Results for: Function Handles

Thoughts about Anonymous Functions 18

Posted by Loren Shure,

One of the reasons I like using anonymous functions is because they allow me to express whatever function I want to use as a function of the relevant arguments in different contexts.... read more >>

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 >>

Combining Functions 9

Posted by Loren Shure,

Combining Functions  For a lot of calculations, it makes sense to combine operations into a single expression. You can sometimes do this easily when you have function handles and you generate one final function... read more >>

Mathematical Recreations: Tweetable Game Of Life 10

Posted by Loren Shure,

Mathematical Recreations: Tweetable Game Of Life  Today I’d like to introduce a guest blogger, Matt, who is consultant over in The MathWorks UK. Some of you may have come across his customer projects and series of demos on using... read more >>

Using str2func for Anonymous Function Handle Creation 25

Posted by Loren Shure,

Using str2func for Anonymous Function Handle Creation  Starting in Release 2009a, str2func lets you create a handle to anonymous function. Before that, you need to construct an anonymous function from literal strings, or using some ugly code involving eval. ... read more >>

Keeping Things Tidy 28

Posted by Loren Shure,

Keeping Things Tidy  In the past, when you opened a file in a MATLAB program, you had to keep track of it so you could close it under all possible conditions, i.e., if reading or processing... read more >>

A Way to Create Reusable Tools 12

Posted by Loren Shure,

A Way to Create Reusable Tools  There are a lot of ways to create reusable tools and widgets in lots of programming languages, including MATLAB. Today I want to illustrate creating a reusable visualization tool that can then... read more >>

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