Navigation

Operators and Keywords

Function List:

C++ API

gradient.m File Reference


Functions

 if (ismatrix(m))[varargout
 elseif (isa(m,"function_handle"))[varargout
 elseif (ischar(m))[varargout
else error ("gradient: first input must be an array or a function")
 if (isvector(m)) transposed
 if (length(sz) > 1) tmp
 sz (1)
 sz (2)
endif if (nargin > 2 &&nargin!=nd+1) print_usage() endif d
 if (nargin==1) for i
endfor elseif (nargin==2) if(isscalar(varargin
endif else if (length(varargin)!=nd) error("dimensions and number of spacing values do not match.")
 if (mr > 1) Y(1
 Y (mr,:)
endif if (mr > 2) Y(2
 ones (1, mc)))
endif if (i==1) varargout
 elseif (i==2) varargout = varargin{i}
endif endfor if (transposed) varargout

Variables

function varargout
 m = m(:)'
endif nd = ndims (m)
 sz = size (m)
for i
 mc = numel (m) / mr
 Y = zeros (size (m), class (m))
 __pad1__
 __pad2__
 __pad3__

Function Documentation

elseif ( = =2  )  = varargin{i}

endfor elseif ( nargin  = = 2  ) 

elseif ( ischar(m)   ) 

elseif ( isa(m,"function_handle")   ) 

else error ( "gradient: first input must be an array or a function  ) 

endif endfor if ( transposed   ) 

endif if ( = = 1  ) 

endif if ( mr  ,
 
)

if ( mr  ,
 
)

endif else if ( length(varargin)!  = nd  ) 

if ( nargin  = =1  ) 

endif if ( nargin  ,
2 &&nargin!  = nd+1 
)

if ( length(sz)  ,
 
)

if ( isvector(m)   ) 

if ( ismatrix(m)   ) 

ones ( ,
mc   
)

Type Constraints

sz (  ) 

sz (  ) 

Y ( mr  ,
 
)


Variable Documentation

for i

Initial value:

 1:nd
        d{i} = varargin{1} * ones (sz(i) - 1, 1)

m = m(:)'

mc = numel (m) / mr

endif nd = ndims (m)

sz = size (m)

Initial value:

 gradient (m, varargin)
  
  if (nargin < 1)
    print_usage ()
  endif

  nargout_with_ans = max(1,nargout)

Y = zeros (size (m), class (m))