Loren on the Art of MATLAB

Turn ideas into MATLAB


Loren on the Art of MATLAB has been archived and will not be updated.

Posts 11 - 18 of 18

Results for: Function Handles

Using str2func for Anonymous Function Handle Creation 25

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... read more >>

Keeping Things Tidy 28

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... read more >>

A Way to Create Reusable Tools 12

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 be... read more >>

Some Ways to Create Function Handles 36

I recently was asked the best way to create function handles, given the names of functions. This came up because I recommended that we should generally remove instances of... read more >>

Handle This! 11

I recently got a great request from a reader to discuss the various kinds of entities in MATLAB attached to the word handle. I want to talk about the parallels and differences of three... read more >>

Nested Function Interaction with Global Variables 7

Recently on two different occasions, people have asked me to help debug their nested function< code. I was struck by the similarity of their problems and today will show you the problem and some... read more >>

Use nested functions to memoize costly functions 27

Some languages provide ways to store results of costly calculations so if the calculation had been performed before, it need not be repeated when requested later. There is a way to accomplish this... read more >>

Mental Model for feval 10

What's your mental model for when to use the MATLAB function feval? Until Release 14 (MATLAB 7), feval was the way to evaluate a function handle. By that I mean you might write code something... read more >>

Posts 11 - 18 of 18