function dm=getDM(traffic,modemlist); %% =========================================================================== % getDM - Finds index in traffic that match modemlist % % Parameter: traffic Current traffic scenario % Parameter: modemlist A list of modems to test % Returns: Index in traffic that matches modems in modemlist % % Example(s): % dm=getDM(traffic,['ADSL';'VDSL']); % % Algorithmic details: % % Reference: % %% =========================================================================== %% =========================================================================== % Copyright (C): % 1998-1999 by Telia Research AB, Lulea, Sweden; % 2000-2003 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Project : FTW's xDSLsimu % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % : Daniel Bengtsson (Daniel.J.Bengtsson@Telia.se) % : Bo Engstrom (bosse@upzide.com) % % CVS: $Id: getDM.m,v 3.4 2003/11/28 16:32:57 tono Exp $ %% =========================================================================== % Change History % 1999-01-05 (DaB) Created % 1999-01-07 (DaB) Fixed bug in indexing % 1999-02-04 (DaB) Changed input format % 1999-02-04 (DaB) Changed name to setDM % 1999-02-05 (ToNo) Changed name back to getDM % 2000-03-31 (UvAn) Changed gui.modems to modems % 2000-10-23 (GS) Modified for different lengths of service names % 2001-06-15 (Bosse) Octave port initiated % 2002-07-01 (PeKa) Octave to Matlab compatibility port % 2002-10-16 (ToNo) Cleaning up the code % 2003-11-03 (ToNo) Lists now use cell arrays for both Octave and Matlab % 2003-11-03 (ToNo) Fixed comparisons even if modemlist contains % trailing spaces %% =========================================================================== dm=[]; for m=1:size(modemlist,1); % For all systems under test for i=1:length(traffic), % Check if they are in the traffic scenario tmprow=traffic{i}; if strncmp(tmprow{3},modemlist(m,:),length(tmprow{3})), if length(dm)==0 dm=i; else dm=[dm i]; end end; end; end;