So far, for data organization, we have mostly used standard arrays that represent useful data structures for storing a large number of objects, but all of the same type, such as a matrix of numbers or characters. However, such arrays cannot be used if you want to memorize both numbers and strings in the same object. This is a problem that can be solved by so-called cell arrays, structure arrays, and more generally all those structures that the MATLAB programming environment provides us.
A cell array is a datatype that has indexed data containers called cells. Each cell can contain any type of data; cell arrays can contain, for example, text strings, combinations of text and numbers, or numeric arrays of different sizes.
To create a cell array, we can simply use the cell array construction operator, that is, the {}
operator (braces), we can see as (name and age of my family members):
>> MyFamily = {'Luigi', 'Simone', 'Tiziana'; 13, 11, 43} MyFamily = 2×3 cell...