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.B.Nordstrom@Telia.se) % : % % CVS: $Id: findStrIndex.m,v 1.2 1999/03/31 13:15:58 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