Home > Objects > @iData > jacobian.m

# iFit/jacobian

## PURPOSE

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

## SYNOPSIS

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

## DESCRIPTION

``` [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
is:
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

## CROSS-REFERENCE INFORMATION

This function calls:
• abs b = abs(s) : absolute value of iData object
• cell [content,fields]=cell(s) : convert iData objects into cells
• copyobj b = copyobj(s) : makes a copy of iData object
• end b = end(s,index,n) : end value for iData objects
• get [...] = get(s, 'PropertyName', ...) : get iData object properties
• getaxis [val, lab] = getaxis(s, AxisIndex) : get iData axis value and label
• iData
• isempty isempty(s) : true for empty iData object
• isequal c = isequal(a,b) : full numerical equality comparison of iData objects
• isnumeric b = isnumeric(s) : True for numeric iData object elements
• isscalar b = isscalar(s) : True for scalar iData objects
• label b = label(s, alias, label) : Change iData label for a given alias/axis
• max [m,id] = max(a,b, dim) : computes the maximum value of iData object(s)
• min [m,id] = min(a,b, dim) : computes the maximum value of iData object(s)
• ndims d = ndims(s) : get the dimensionality of iData object
• ones s = ones(s,N,M,P,...) : initialize an iData array
• rdivide c = rdivide(a,b) : computes the ratio of iData objects
• reshape c = reshape(a) : reshape the object Signal
• set [s,...] = set(s, 'PropertyName', Propertyvalue, ...) : set iData properties
• setalias [s,...] = setalias(s, AliasName, AliasLink, {AliasLabel}) : set iData aliases
• setaxis s = setaxis(s, rank, alias, value) : set iData axes
• size size(s) : get iData object size (number of elements)
• times c = times(a,b) : computes the product of iData objects
• unique s = unique(a,dim) : set unique iData objects axes with no repetitions
• zeros s = zeros(s,N,M,P,...) : initialize an iData array
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