%% Optional Output Formats
% This example shows how to pass optional inputs to certain functions to change the output format provided from the function.
% Create a new parameter structure, enb.

enb.NCellID = 0;
enb.CellRefP = 1;
enb.NSubframe = 0;
enb.NDLRB = 9;
enb.Ng = 'Sixth';

% For example, consider the case where a list of indices for a certain physical channel is generated using ltePCFICHIndices.
%
% The input argument, enb, is a structure with the appropriate fields. By default, these indices are one-based, as opposed to the zero-based indices specified in the technical specification (TS) documentation.

ind = ltePCFICHIndices(enb);
firstIndex = ind(1)

%
% Change the base number used in the index generation by providing an additional optional input argument. Specify '0based' to generate zero-based indices or '1based' to generate one-based indices.

ind = ltePCFICHIndices(enb, '0based');
firstIndex_0based = ind(1)
ind = ltePCFICHIndices(enb, '1based');
firstIndex_1based = ind(1)

% The first index generated when no optional argument is provided matches the first index when '1based' is specified. The optional input is not required. If you do not specify an optional input, the function uses the default value.
%
% Specify multiple output format options for a function by providing a cell array input argument, opts.

opts = {'sub', '1based', 'reg'};
pcfichInd = ltePCFICHIndices(enb, opts)

% The generated PCFICH indices are in subscript indexing style, one-based, and refer to resource element groups. The cell array of options that you specify indicates the format for the returned indices.
%
% Varying the order of the opts cell entries produces the same result.

opts = {'1based', 'sub', 'reg'};
pcfichInd = ltePCFICHIndices(enb, opts)

% The order in which you provide the opts inputs is not relevant. Both cases produce the same values in the output argument, pcfichInd.
% Copyright 2012 The MathWorks, Inc.