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__ |
elseif | ( | i | = =2 |
) | = varargin{i} |
elseif | ( | ischar(m) | ) |
elseif | ( | isa(m,"function_handle") | ) |
endif if | ( | i | = = 1 |
) |
if | ( | mr | , | |
1 | ||||
) |
if | ( | nargin | = =1 |
) |
if | ( | length(sz) | , | |
1 | ||||
) |
if | ( | isvector(m) | ) |
if | ( | ismatrix(m) | ) |
ones | ( | 1 | , | |
mc | ||||
) |
sz | ( | 2 | ) |
sz | ( | 1 | ) |
Y | ( | mr | , | |
: | ||||
) |
m = m(:)' |
sz = size (m) |
endif endfunction function varargout |
Y = zeros (size (m), class (m)) |