Home > brede > brede_struct_select.m

brede_struct_select

PURPOSE ^

brede_struct_select - Select fields from structures

SYNOPSIS ^

function O = brede_struct_select(L, varargin)

DESCRIPTION ^

 brede_struct_select    - Select fields from structures

      function O = brede_struct_select(S)

      Input:    S      Structures

      Property: Select [ {''} | a field in S | INDEX ]
                       Determines which fields should be returned. If
                       empty the entire structure will be returned 
                Where  Cell with 3 elements: "column", condition and
                       value. Condition can be 'any(==)' 'findstr',
                       'findstri' 'fstrfindi' 'strcmp', 'strcmpi',
                       'strfindi' 'strmatch', 'strmatchi', 
                       'strmatchx' or '=='
           
      Output:   O      Output, eg, 'struct structures

      This function works somewhat similar as an SQL SELECT command. 

      Matching is performed, eg:

      findstr   : findstr(lower(column), lower(value))
      fstrfindi : strfind(lower(column), lower(value))
      strfindi  : strfind(lower(value), lower(column))

      Examples: 
        f = fullfile(fileparts(which('brede')), 'xml', 'wobibs.xml');
        B = brede_read_xml(f, 'output', 'collapsesecond');
        L = brede_bib_bib2struct(B);
        BA = brede_struct_select(L, 'select', 'brodmann');
        unique(BA)

        L18 = brede_struct_select(L, 'where', {'brodmann' 'strcmp' '18'})

        V5 = brede_struct_select(L, 'select', 'functionalArea',
        'where', { 'functionalArea' 'strmatch' 'V5' })

      See also BREDE, BREDE_BIB_SELECT, BREDE_LOC_SELECT,
               BREDE_EXP_SELECT.

 $Id: brede_struct_select.m,v 1.10 2005/06/08 20:23:56 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