SUNY Geneseo Department of Computer Science


Introduction to Cell Arrays

Friday, April 18

CSci 120, Spring 2014
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture

Questions?

How to save database?

    >> load database
>> save newdatabase

Cell Arrays

Downloading database.mat file: if your browser tries to open the file instead of download it when you click on the link, try right-clicking and using “Download Link” command in resulting menu

In cell arrays, “tuple” = row

Cells vs content

Vector of numbers, vs cell vector of cells which refer to strings, numbers, etc.

    >> c = { 'Isaac Newton' 1666 }
    c = 
        'Isaac Newton'    [1666]
    >> c{2}
    ans =
            1666
    >> c(2)
    ans = 
        [1666]
    >> date = c{2}
    date =
            1666
    >> datecell = c(2)
    datecell = 
        [1666]
    >> datecell + 3
    Undefined function 'plus' for input arguments of type 'cell'.
    >> datecell{1} + 3
        ans =
            1669

2 cells, 1st containing string 'Isaac Newton'; 2nd containing number 1666


Next Lecture