function [ispartofmmpc, blkp] = mpc_ispartofmmpc(blockname)
% MPC_ISPARTOFMMPC Return true if a MPC block is a member of a MMPC block
% and the MMPC block name.  Otherwsie, return false with the MPC block
% name.
%
% Input: blockname is the full path of an MPC block.

%   Author(s): R. Chen
%   Copyright 1986-2011 The MathWorks, Inc.

blkp = get_param(blockname,'Parent');
ispartofmmpc = strcmp(get_param(blkp,'Type'),'block') && strcmp(get_param(blkp,'MaskType'),'Multiple MPC');
if ~ispartofmmpc
    blkp = blockname;
end