function index=findStrIndex(strarray,str); %% =========================================================================== %findStrIndex - Find string (index) in array of strings % % Parameter: strarray Array of strings % Parameter: str String to find % Returns: index Index of string (1 if not found) % % Example(s): % i=findStrIndex(MenuArray,'Exit'); % % Algorithmic details: % % Reference: % %% =========================================================================== %% =========================================================================== % 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: findStrIndex.m,v 1.4 2000/03/10 13:45:59 tono Exp $ %% =========================================================================== % Change History % 1999-01-11 (ToNo) Created %% =========================================================================== index=1; for i=1:length(strarray(:,1)), if strcmp(deblank(strarray(i,:)),str) index=i; break; end end