Skip to content

subsasgn

  SUBSASGN method overloaded for tstamp objects.

  Examples:
  OBJ.PROP =VAL
  OBJ.PROP1.PROP2 = VAL
  etc. assigns the value B to the specified property of the tstamp object
  See TSTAMP/TSTAMP for a list of properties

  Note:
  Treating obj as a double precision array i.e. using
  OBJ(...)= x
  is not expected to be used in code specifically designed for
  tstamps but works as follows:

  SUBSASGN converts all the data to double precision, scales it, applies
  the offset, executes obj.Func, does the assignment on the result and then
  returns it, i.e.
    obj(...) = ...mycode...
  is equivalent to
    obj=obj(); % Calls tstamp.subsref and returns a double precision array
    obj(...) = ...mycode... % Assigns values to the double array
  Note that the tstamp object is destroyed

  This behaviour is sometimes useful as it allows tstamp objects to be
  passed as inputs to some MATLAB functions that were not designed to take
  them  e.g.,
    y=filtfilt(a, b ,obj)
  where obj contains an MxN array executes a line in filtfilt:
    y = obj;
  that will make a copy of the object (no call to SUBSASGN). Then
    for i=1:n  % loop over columns
    y(:,i) = filtfilt(b,a,obj(:,i));
    end
  calls SUBSASGN which converts y to double precision on its first iteration.
  Throughout, obj remains an tstamp object accessed via SUBSREF so this
  is more memory efficient than
    y=filtfilt(a, b ,obj())
  where both obj and y are stored throughout as double precision arrays.

  See also SUBSASGN, TSTAMP/SUBSREF, TSTAMP/TSTAMP, TSTAMP/SET

  Author: Malcolm Lidierth
  Copyright © The Author & King's College London 2006

 Correction 21/7/06 - delete isfield(val,'Repeat')