MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

Pass Contents of Cell Arrays to Functions


These examples show several ways to pass data from a cell array to a MATLAB® function
that does not recognize cell arrays as inputs.

Pass the contents of a single cell by indexing with curly braces, {}.

This example creates a cell array that contains text and a 20-by-2 array of random
numbers.

randCell = {'Random Data', rand(20,2)};
plot(randCell{1,2})
title(randCell{1,1})

Pass Contents of Cell Arrays to Functions
Free download pdf