%% Append Cell Array to Bottom of Text File
% Append cell arrays to the bottom of a text file containing existing data.
% Create three cell arrays in the workspace.

states = {"Massachusetts","New York","Maryland","Virginia"}
stateBird = {"Black-capped chickadee","Eastern bluebird",...
    "Baltimore oriole","Cardinal"}
stateFlower = {"Trailing arbutus","Rose",...
    "Black-eyed Susan","Flowering dogwood"}

% Write the cell array states to the file states.txt. Then write the arrays stateBird and stateFlower below the existing entries in the text file.

writecell(states,'states.txt')
writecell(stateBird,'states.txt','WriteMode','append')
writecell(stateFlower,'states.txt','WriteMode','append')

% Read and display the cell array.

readcell('states.txt')

% Copyright 2019 The MathWorks, Inc.