Code covered by the BSD License  

Highlights from
NLCSmoothReg

image thumbnail
from NLCSmoothReg by Michael Wendlandt
Computes a smooth regularized solution of an ill-posed discrete linear inverse problem.

ddL2=L2_2d(n,dimr,dimc);
function ddL2=L2_2d(n,dimr,dimc);

% calculates the nth derivative matrix with respect to each columnvector of a
% matrix (dimr x dimc)

% length of a column-vector after derivation
dddim=dimr-n;

% make second derivative matrice for one column
ddL=full(get_l(dimr,n));

% put together to form final matrix
for i=1:(dimc)
    ddL2( ((i-1)*dddim +1) : (i*dddim) , ((i-1)*dimr + 1) : i*dimr   ) = ddL;
end

Contact us at files@mathworks.com