Loren on the Art of MATLAB

Results for: Defaults

Optional Arguments Using Empty as Placeholder 11

Posted by Loren Shure,

Optional Arguments Using Empty as Placeholder  I recently posted about optional input arguments and how to override default values. Gautam mentioned wanting to allow empty inputs as defaults. Contents ... read more >>

Nice Way to Set Function Defaults 37

Posted by Loren Shure,

Nice Way to Set Function Defaults  Last week, I wrote a post on the switch statement in MATLAB. One theme in the comments was about using switch (or not!) for setting default values for input arguments that users didn't initialize. I realized that there is... read more >>

Constants 10

Posted by Loren Shure,

Constants  Users have occasionally asked how to create and use constants in MATLAB. Here's one such example. In some cases, they would like to create a constant that other users or programs can't change. Unlike ... read more >>

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