实体选择器块使用“键元素”来搜索“键”属性以匹配其他输入的属性。
但是,没有预先编程的可能性来输入“Key”元素的多个属性。例如, WheelSize 和颜色都应该匹配。
在源代码中,开头的代码有以下摘录:
properties (Nontunable)
% Number of matching streams
mNumberOfStreams = 1;
% Key entity attribute name
mKeyEntityAttributeName = {'ID'};
% Matching entity attribute name(s)
mEntityAttributeName = {'Type'};
% Entity output behavior
mEntityOutputOpt = 'Together';
% Number of entities source
mMatchingNumberSource = 'Dialog';
% Number of entities to select
mNumberOfMatches = 1;
% Key attribute for number of entities
mNumberOfMatchesAttribute = 'Name';
% Custom matching function name
mCustomMatchFuncName = '';
end
知道这很可能还不够,我曾尝试将 mNumberOfStreams 和 mNumberOfMatches 设置为“2”,但是(合理地)阻止了保存代码。后来我也明白了:这些只是块的预写属性。
不幸的是,我在附图中尝试的变体也没有成功(回想起来是合乎逻辑的,因为源代码也明确地谈到了 ONE match)。
有谁知道在 Simulink / SimEvents 的实体选择器中定义 2 个或更多关键实体属性名称的可能性?
我将非常感激!
最好的问候卢卡