function commFixBrokenLinksRateOption(unlnkBlk, newBlk)
%commFixBrokenLinksRateOption(unlnkBlk, newBlk)
%
% Set RateOptions to Inherited when unlinked block does not have this
% parameter.
%
% Called from slupdate.

%   Copyright 2011 The MathWorks, Inc.
             
    unlnkBlkHasRate   = localHasRateOption(unlnkBlk);

    if ~unlnkBlkHasRate
        set_param(newBlk, 'RateOptions', ...
            'Inherit from input (this choice will be removed - see release notes)');        
    end
    
end

function result = localHasRateOption(block)
    dp = fields(get_param(block, 'DialogParameters'));
    result = ~isempty(find(cell2mat(strfind(dp, ...
            'RateOptions')), 1));
end

% End commFixBrokenLinksRateOption
