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-2009 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 752 2009-01-02 13:03:52Z tono $ %% =========================================================================== % 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 % 2008-08-25 (ToNo) Changed the trailing space fix to use strtrim, % and made comparison exact (diff btw VDSL and VDSL2) %% =========================================================================== 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 strcmp(strtrim(tmprow{3}),strtrim(modemlist(m,:))), if isempty(dm) dm=i; else dm=[dm i]; end end; end; end;