function [initializationParams, algorithmParams, dimParams] = ...
    maskInitializationRecursivePolyModelEst(blkH,dlgParams)
% maskInitializationRecursivePolyModelEst MaskInit fcn for the Recursive
% Polynomial Model Estimator block
%
%   Inputs:
%     blkH      - Block handle
%     dlgParams - Structure that contains the dialog parameters. This is
%                 created in the 'Mask Initialization' tab of the blk mask.
%
%   Outputs:
%     initializationParams - Parameters that are necessary for block
%                            initialization
%     algorithmParams      - Parameters that are used in the recursion step

%   Copyright 2013-2018 The MathWorks, Inc.

% Set the IO ports provided to the user based on the dialog settings
controllib.internal.blocks.rls.setBlockIOPorts('polyModelEst',blkH,dlgParams.EstimationMethod);

% Error checking: Skip the error checking if this function is triggered by
% the user clicking the 'OK' or 'Apply' buttons on the dialog
if strcmp(get_param(bdroot,'SimulationStatus'),'stopped')
    % User just interacted with the dialog. Skip error checking
    initializationParams = [];
    algorithmParams = [];
    dimParams = [];
else
    % Process user data and report any errors 
    [initializationParams, algorithmParams, dimParams] = ...
        recursiveEstimation.processDialogDataRecursivePolyModelEst(dlgParams);
end
end
