This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

Combining Cell Arrays with Non-Cell Arrays

Combining a number of arrays in which one or more is a cell array returns a new cell array. Each of the original arrays occupies a cell in the new array:

A = [100, {uint8(200), 300}, 'MATLAB'];
whos A
  Name      Size            Bytes  Class    Attributes

  A         1x4               477  cell

Each element of the combined array maintains its original class:

fprintf('Classes: %s %s %s %s\n',...
Classes: double uint8 double char
Was this topic helpful?