Home > classes > @plist > find.m

find

PURPOSE ^

FIND overloads find routine for a parameter list.

SYNOPSIS ^

function a = find(pl, key)

DESCRIPTION ^

 FIND overloads find routine for a parameter list.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: FIND overloads find routine for a parameter list.
              Returns the value(s) corresponding to all parameters in
              the list with key 'key'.

 CALL:        a = find(pl, 'key')

 VERSION:     $Id: find.m,v 1.2 2007/07/18 13:58:45 ingo Exp $

 HISTORY:     02-02-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function a = find(pl, key)
0002 % FIND overloads find routine for a parameter list.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: FIND overloads find routine for a parameter list.
0007 %              Returns the value(s) corresponding to all parameters in
0008 %              the list with key 'key'.
0009 %
0010 % CALL:        a = find(pl, 'key')
0011 %
0012 % VERSION:     $Id: find.m,v 1.2 2007/07/18 13:58:45 ingo Exp $
0013 %
0014 % HISTORY:     02-02-2007 M Hewitson
0015 %                 Creation
0016 %
0017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0018 
0019 ps = get(pl, 'params');
0020 np = length(ps);
0021 a  = [];
0022 
0023 for i=1:np
0024   p = ps(i);
0025   if strcmp(p.key, key)
0026     a = [a p.val];
0027   end
0028 end
0029 
0030 
0031 
0032 % END

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003