function object = getList(list,name); %getList - get an object from a list based on the name of the objects. % % Parameter: list The list to be searched % Parameter: name Name to search for % Returns: object The object found % % Example(s): % tfplan = getList(ex.tflist,'Zipper'); % %% =========================================================================== %% =========================================================================== % Copyright (C) 1999 by Telia Research AB, Lulea, Sweden; All rights reserved. % Project : FSAN simulator % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % : Daniel Bengtsson (Daniel.J.Bengtsson@Telia.se) % % CVS: $Id: getList.m,v 1.4 2000/03/10 13:45:59 tono Exp $ %% =========================================================================== % Change History % 1999-02-25 (ToNo) Created %% =========================================================================== len = length(list); found=0; for i=1:len, if strcmp(list(i).name, name) object=list(i); found=1; end end %check if we found anything if ~found estr=sprintf('Varning in getList: object %s not found', name); disp(estr); object = []; end