Home > brede > brede_struct_field2str.m

brede_struct_field2str

PURPOSE ^

brede_struct_field2str - Convert field to cellstr

SYNOPSIS ^

function s = brede_struct_field2str(S, f)

DESCRIPTION ^

 brede_struct_field2str - Convert field to cellstr

       s = brede_struct_field2str(f)
       s = brede_struct_field2str(S, f)

       Input:  S   Structure
               f   Field represented as numeric, string, cellstring 
 
       Output: s   String

       This will convert the first element in a field to a string. If
       the field is already a string the string will be returned
       unchanged.

       If the function is called with two input arguments the first
       argument should be a structure and the second a string with
       the field name. If the field name does not exist an empty
       string is returned.

       Example:
         brede_struct_field2str(1)
         brede_struct_field2str({ '2' '3' })
         brede_struct_field2str('4')

         A.title{1} = 'Memory';
         A.title{2} = 'Hukommelse';
         brede_struct_field2str(A, 'title')

       See also BREDE, BREDE_STR, BREDE_STRUCT_FIELD2CELLSTR.

 $Id: brede_struct_field2str.m,v 1.3 2005/11/09 13:16:55 fnielsen Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 27-Nov-2009 18:11:22 by m2html © 2005