function hTable = crl_table_small_matrix()
% Create a function to call the code replacement library table 

%% Create a table object
hTable = RTW.TflTable;
LibPath= fullfile(matlabroot,'examples','coder');

%% Create an entry
hEntry = RTW.TflCOperationEntry;

%% Create entry parameters
hEntry.setTflCOperationEntryParameters(...
     'Key',                      'RTW_OP_ADD', ...
     'Priority',                 30, ...
     'SaturationMode',           'RTW_WRAP_ON_OVERFLOW', ...
     'ImplementationName',       'matrix_sum_2x2_double', ...
     'ImplementationHeaderFile', 'MatrixMath.h', ...
     'ImplementationSourceFile', 'MatrixMath.c', ...
     'ImplementationHeaderPath', LibPath, ...
     'ImplementationSourcePath', LibPath, ...
     'AdditionalIncludePaths',   {LibPath}, ...
     'SideEffects',              true);


%% Create the conceptual representation
createAndAddConceptualArg(hEntry, 'RTW.TflArgMatrix', ...
                          'Name',         'y1', ...
                          'IOType',       'RTW_IO_OUTPUT', ...
                          'BaseType',     'double', ...
                          'DimRange',     [2 2]);
createAndAddConceptualArg(hEntry, 'RTW.TflArgMatrix',...
                          'Name',         'u1', ...
                          'BaseType',     'double', ...
                          'DimRange',     [2 2]);
createAndAddConceptualArg(hEntry, 'RTW.TflArgMatrix',...
                          'Name',         'u2', ...
                          'BaseType',     'double', ...
                          'DimRange',     [2 2]);


%% Create the Implementation Representation
arg = getTflArgFromString(hTable, 'y2', 'void');
arg.IOType = 'RTW_IO_OUTPUT';
hEntry.Implementation.setReturn(arg);

arg = getTflArgFromString(hTable, 'u1', ['double' '*']);
hEntry.Implementation.addArgument(arg);

arg = getTflArgFromString(hTable, 'u2', ['double' '*']);
hEntry.Implementation.addArgument(arg);

arg = getTflArgFromString(hTable, 'y1', ['double' '*']);

arg.IOType = 'RTW_IO_OUTPUT';
hEntry.Implementation.addArgument(arg);


%% Add the entry to the table
hTable.addEntry(hEntry);