function list=setList(list,name,object); %setList - set a named object in a list to a new value (object). % % Parameter: list The list to be searched % Parameter: name Name to search for % Parameter: object the new value % Returns: list The modified list % % Example(s): % tfplan = getList(ex.list,'Zipper'); % tfplan.PBOmethod='rl'; % tfplan.PBOparam=1500; % ex.list=setList(ex.list,'Zipper',tfplan); % %% =========================================================================== %% =========================================================================== % Copyright (C) 1999 by Telia Research AB, Lulea, Sweden; All rights reserved. % Project : FSAN duplex model % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % : Daniel Bengtsson (Daniel.J.Bengtsson@Telia.se) % % CVS: $Id: setList.m,v 1.5 2000/11/07 12:43:26 tono Exp $ %% =========================================================================== % Change History % 1999-02-25 (ToNo) Created %% =========================================================================== len = length(list); found=0; for i=1:len, if strcmp(list(i).name, name) list(i)=object; found=1; break; end end % Check if we found anything if ~found estr=sprintf('Varning in setList: object %s not found', name); disp(estr); end