Site hosted by Angelfire.com: Build your free website today!

keepfield

PURPOSE ^

OUTSTRUCT = KEEPFIELD(INSTRUCT,FIELDNAMES)

SYNOPSIS ^

function outstruct = keepfield(instruct,fields)

DESCRIPTION ^

 OUTSTRUCT = KEEPFIELD(INSTRUCT,FIELDNAMES)
 Removes all fields from a structure other than those specified in 
 input variable FIELDS. 

 FIELDS may be a single field, or a cell array of field names

 ex:
 a = dir('*.m');
 b = keepfield(a,{'name','bytes'});

 See also: rmfield

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^


Generated on Sat 12-Mar-2005 01:01:49 by Rezaul Karim © 2004