Not. They are not at all the same. The only aspect that is one and the same is the resulting form.
An array (which you build with []) is something you can use for linear algebra. One number in each item.
A = [1 2 3;4 5 6;7 8 9]; [3 5 7]*A*[2 3 5]' ans = 915
A cell array is a common container that will contain any object, any matlab variable completely in each cell. Thus, we can create an array of cells consisting of elements of any shape and size.
C = {'The' 'quick' 'brown' 'fox' 'jumps' 'over' 'the' 'lazy' 'dog'};
C is an array of cells with 9 elements in it. We can put any class of variables into it.
C = {'asfghhrstyjtysj', 1:5, magic(4), sqrt(-1)} C = 'asfghhrstyjtysj' [1x5 double] [4x4 double] [0 + 1i]
We could even create an array of cells, where each cell contains only one scalar number. But it would not make real sense, since we cannot perform arithmetic operations using arrays of cells.
user85109
source share