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.

搜索结果: Cell Arrays

Which Way to Compute: cellfun or for-loop? 9

Over a long number of years, people have asked whether it's better to use cellfun or a for-loop to perform certain computations. As with so many things in life, the correct answer here is "it depends". Let me give you a bit more insight so you can make good choices.... 更多内容 >>

Partitioning a Vector 9

Recently on the MATLAB newsgroup, there was a thread asking how to split up a vector into pieces which were each monotonically increasing by the value 1. The post got several answers which I did not read first. Here's my thinking.... 更多内容 >>

Dealing with Cells 37

A customer recently asked me this question at the MATLAB Virtual Conference. Contents ... 更多内容 >>

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 ... 更多内容 >>

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.... 更多内容 >>

Deal or No Deal 21

This post continues in the theme from my last post, where people routinely come to me on a topic. Today I want to distinguish
between indexed assignment, where you can take advantage of scalar... 更多内容 >>

Cell Arrays and Their Contents 117

I've written several blog articles so far on structures, and not quite so much on their soulmates, cell arrays. Just last week, at the annual MathWorks Aerospace Defense Conference (MADC), I had... 更多内容 >>