function iconStr = commblkGetModDemodBlkIconStrM_ary(M, iconStrDefault)
%COMMBLKGETMODDEMODBLKICONSTRM_ARY Communications Toolbox helper function.
%
%  USAGE: iconStr = commblkGetModDemodBlkIconStrM_ary(M, iconStrDefault)
%
%  Note that this function ASSUMES that iconStrDefault begins with 'M'.

% Copyright 2007-2018 The MathWorks, Inc.

if isnumeric(M) && isscalar(M)
    % Use the numeric value of M to construct a more specific string
    iconStr = strcat(num2str(M), iconStrDefault(2:end));

    if isequal(M,2) || isequal(M,4)
        switch iconStrDefault
            case 'M-PSK'
                if isequal(M,2)
                    iconStr = 'BPSK';
                else
                    iconStr = 'QPSK';
                end

            case 'M-DPSK'
                if isequal(M,2)
                    iconStr = 'DBPSK';
                else
                    iconStr = 'DQPSK';
                end
        end
    end
else
    % M is not numeric or is non-scalar (just use the default string...)
    iconStr = iconStrDefault;
end

% [EOF]
