⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trace_mux_network.m

📁 CheckMate is a MATLAB-based tool for modeling, simulating and investigating properties of hybrid dyn
💻 M
字号:
function inputblks = trace_mux_network(dstblk,dstport)

% Find handles and order of muxed input blocks
%
% Syntax:
%   "inputblks = trace_mux_network(dstblk,dstport)"
%
% Description:
%   "trace_mux_network(dstblk,dstport)" returns, in order, the input
%   blocks that are muxed together before feeding into the destination
%   port "dstport" of the destination block "dstblk".
%
% See Also:
%   trace_pthb_input,trace_scsb_input

src = find_src_port(dstblk,dstport);
if isempty(src)
  error(sprintf('Input port "%s" of block "%s" is not connected.', ...
        dstport,get_param(dstblk,'Name')));
end
inputblks = find_mux_input_blocks(src.block);
return

% -----------------------------------------------------------------------------

function inputblks = find_mux_input_blocks(block)

BlockType = get_param(block,'BlockType');
if strcmp(BlockType,'Mux')
  inputblks = [];
  n = eval(get_param(block,'Inputs'));
  for k = 1:n
    src = find_src_port(block,num2str(k));
    if isempty(src)
      error(sprintf('Input port "%d" of block "%s" is not connected.', ...
          k,get_param(block,'Name')));
    end
    inputblks = [inputblks; find_mux_input_blocks(src.block)];
  end
else
  inputblks = block;
end
return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -