Programming Previous page   Next Page

Comma-Separated Lists

Typing in a series of numbers separated by commas gives you what is called a comma-separated list. MATLAB returns each value individually:

Such a list, by itself, is not very useful. But when used with large and more complex data structures like MATLAB structures and cell arrays, the comma-separated list can enable you to simplify your MATLAB code.

This section covers

Generating a List from a Cell Array

Extracting multiple elements from a cell array yields a comma-separated list. Given a 4-by-6 cell array as shown here

extracting the fifth column generates the following comma-separated list:

This is the same as explicitly typing


Previous page  Operator Summary Generating a List from a Structure Next page

© 1994-2005 The MathWorks, Inc.