syminfo.m

来自「由matlab开发的hybrid系统的描述语言」· M 代码 · 共 64 行

M
64
字号
function info = syminfo(S, vname, vtype, vkind, vindex)% info = syminfo(S, vname, vtype, vkind, vindex)% extract infos from the symble table% look up the symble table for entries matching the query % item.name == name AND item.type == type AND item.kind == kind% empty field ('') matches all entries% % INPUT:% S     : the system name% vname : var name as in the Hysdel source% vtype : var type ('b','r')% vkind : var kind ('x','u','d','z')% vindex: var index%% OUTPUT% info  : cell array of info records saisfying the query% % REMARK% the contents of the syminfo records are detailed in the HYSDEL manual in the % section describing the MLD-structure% % (C) 2001 by F.D. Torrisi% Automatic Control Laboratory, ETH Zentrum, CH-8092 Zurich, Switzerland% torrisi@aut.ee.ethz.ch%% see license.txt for the terms and conditions.if nargin == 0   disp('Version 0.01')   info='0.01';   returnend  error(nargchk(1,5,nargin));% ==============================================================================% Define optional arguments% ==============================================================================if nargin <= 4   vindex = '';endif nargin <= 3	vkind = '';endif nargin <= 2   vtype = '';end   if nargin <= 1   vname = '';endN_s = size(S.symtable,2);rep = 0;for i = 1:N_s   if (isempty(vname) | strcmp(S.symtable{i}.name,vname)) & ...      (isempty(vtype) | strcmp(S.symtable{i}.type,vtype)) & ...      (isempty(vkind) | strcmp(S.symtable{i}.kind,vkind)) & ...      (isempty(vindex) | S.symtable{i}.index == vindex) ,      rep = rep + 1;      info{rep} = S.symtable{i};   endend

⌨️ 快捷键说明

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