get_machine_id.m

来自「CheckMate is a MATLAB-based tool for mod」· M 代码 · 共 19 行

M
19
字号
function machine_id = get_machine_id(sys)% the Stateflow function returns all block names whose begining substring% matches with the name given in sys. thus, we have to make sure that we get% an exact match.possible_id = sf('find','all','machine.name',sys);machine_id = [];for k = 1:length(possible_id)  name = sf('get',possible_id(k),'.name');  if strcmp(name,sys)    machine_id = possible_id(k);    break;  endendreturn% ----------------------------------------------------------------------------

⌨️ 快捷键说明

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