Loren on the Art of MATLAB

Turn ideas into MATLAB

Note

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

Posts 371 - 380 of 539

From struct to dataset 14

When I got to work last Friday, I saw an email discussion, on behalf of a customer, trying to find a good way to add a new field to a struct array.... read more >>

Optional Arguments Using Empty as Placeholder 11

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 40

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 a nice pattern for setting these values that uses some compact, but readable code.... read more >>

Switching Things Up 22

If you have ever used a switch statement in MATLAB and also used it in C, you might have noticed that the two constructs have different semantics. Contents ... read more >>

Learning MATLAB 9

Do you learn best by reading, watching, or doing? I do best with a combination of all three for learning technical material. Contents ... read more >>

Convenient nargout Behavior 8

Here's a question that was recently posed at MathWorks. I'm trying to invoke a function handle. It either returns 0 or 1 output arguments. If it returns an output ... read more >>

Palindrome Numbers 9

Today I'd like to introduce a guest blogger, Mike Garrity, who is a graphics software developer at The MathWorks. Although his degree was in computational fluid dynamics, he... read more >>

Technique for Visual Image Comparison 6

Recently Steve wrote an interesting post entitled Image Overlay Transparency that I found quite interesting. Contents ... read more >>

Say “Aloha” to Another MATLAB Stash 2

I recently had the good fortune to spend some time on "The Garden Island," an island in the 50th state to join the USA. Contents ... read more >>

Four Color Images 12

I recently attended a show at the Institute for Contemporary Art in Boston featuring work by Shepard Fairey. It got me thinking how simple it can be in MATLAB to make a 4-color image and... read more >>

Posts 371 - 380 of 539

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