print cell to screen in matlab

To print cell array to the command window in Matlab, one can use the disp function. Here's an example:

myCell = {'apple', 'banana', 'cherry', 1, 2, 3};
disp(myCell)
62 chars
3 lines

This will print the contents of the cell array myCell to the command window. The output will look something like this:

main.m
'apple'    'banana'    'cherry'    [1]         [2]         [3]        
71 chars
2 lines

Each element of the cell array is printed, separated by tabs. If a cell contains a string or a number, it is printed as is. If it contains another cell array or a matrix, it is printed with brackets and commas.

gistlibby LogSnag