Home > Objects > @iData > jacobian.m



[b, j] = jacobian(a, new_axes, 'new_axes_labels'...) : computes the gradient (derivative) of iData objects


function [b, j] = jacobian(a, varargin)


 [b, j] = jacobian(a, new_axes, 'new_axes_labels'...) : computes the gradient (derivative) of iData objects

   @iData/jacobian computes the Jacobian from the object current axes to new axes. 
   This is to be used for object coordinate/variable changes from the
   given object axes to new axes. The 'from' and 'to' axes should have the same dimensions.

   The transformed object is returned, as well as the Jacobian which was used 
   for the transformation.
     b=jacobian(s, d) where 'd' is an iData object computes 's' on the 'd' axes.
     b=jacobian(s, X1,X2, ... Xn) where 'X1...Xn' are vectors or matrices as 
                                  obtained from ndgrid
     b=jacobian(s, {X1,X2, ... Xn}) is the same as above
     b=jacobian(s, ..., 'xlab','ylab',...) specifies the new axes labels
     b=jacobian(s, ..., {'xlab','ylab',...})
   The Jacobian is not a mere axis assignement, nor an interpolation.

   The Jacobian tranform retains the full integral of the initial object, that
      trapz(s,0) == trapz(jacobian(s, ...),0)

   A direct axes assignation is perfomed by using 'setaxis' (which does not affect
   the Signal, and retains its sum, but not its integral). 
   A direct axes rebinning can be performed by using 'interp' (which affects the
   Signal, its sum, but usually retains its integral).
 input:  a: object or array (iData)
         d: single object from which 'to' axes are extracted (iData)
            or a cell containing axes d={X1,X2, ... Xn}      (cell)
         X1...Xn: vectors or matrices specifying axis for 
            dimensions 1 to ndims(s) (double vector/matrix)
         'xlab','yalb'...: axes labels (char)
         {'xlab','yalb'...}: axes labels (cellstr)
 output: b: object or cell array (iData) with new axes
         j: jacobian used to correct the Signal and Error for the axes change (double).
 ex:     a=iData(peaks); x=linspace(1,2,size(a,1));
         g=jacobian(a, x, [],'half X');

 Version: Nov. 26, 2018
 See also iData, iData/del2, diff, iData/gradient, iData/interp, iData/setaxis, gradient


This function calls: This function is called by:
Generated on Mon 26-Nov-2018 15:08:42 by m2html © 2005. iFit (c) E.Farhi/ILL EUPL 1.1