Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the 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',...
        class(A{1}),class(A{2}),class(A{3}),class(A{4}))
Classes: double uint8 double char
Was this topic helpful?