Home > Objects > @iData > fileattrib.m

iFit/fileattrib

PURPOSE ^

[attribute, link] = fileattrib(s, field) : return a field Attribute

SYNOPSIS ^

function [b, link] = fileattrib(a, field, allfields)

DESCRIPTION ^

 [attribute, link] = fileattrib(s, field) : return a field Attribute

   @iData/fileattrib function which looks for an associated Attribute to a field.
      Attributes are set from e.g. NetCDF/CDF/NeXus/HDF files.
      returns []  when no attribute exists
      returns NaN when the field is already an attribute

   s=fileattrib(s, field, attributes) sets the attribute for given field and return
     the updated object.

 input:  s:     object or array (iData)
         field: Alias/path in the object (string)
         attributes: when given as a structure, sets the attributes for the field.
                     when given as a cellstr, it is used for a faster search of
                       attributes, e.g. attributes=fieldfield(a)
 output: attribute: the value of the associated Attribute, or [].
                    or the updated object when storing attributes.
         link:      the path of the associated Attribute, or [].
 ex:     b=fileattrib(a, 'Signal'); 
         b=fileattrib(b, 'Signal',struct('long_name','hello world'))

 Version: Nov. 27, 2018
 See also iData, isfield

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Tue 27-Nov-2018 10:56:24 by m2html © 2005. iFit (c) E.Farhi/ILL EUPL 1.1