%% Visitor Class to Modify Contents of Cell Array
% In this example, the CellModifyVisitor class implements the operations to modify the contents of cell arrays of types bool, double, and char, and contained cell arrays. You can add new operations to support other cell array contents by adding more overloaded functions.
% The ModifyCell function calls apply_visitor_ref in a loop for each element in the cell array. Because the objective is to modify the contents of the cell array, this example uses references to the cell array contents.

type CellModifyVisitor.cpp

% To use the class, pass a cell array to the ModifyCell function.

type callModifyCell.cpp

% Copyright 2012 The MathWorks, Inc.