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.

Lt=trans2d(dimr,dimc);
function Lt=trans2d(dimr,dimc);

% if the (dimr x dimc) sized matrix g is presented in the form g = reshape(g,dimr*dimc,1),
% then trans2D calculates the matrix Lt, such that g_trans = Lt * g = reshape(reshape(g,dimr,dimc)',dimr*dimc,1)

Lt=zeros(dimr * dimc);

indx=1;
for r=1:dimr
    for c=1:dimc
        Lt(indx,r + (c-1) * dimr)=1;
        indx=indx+1;
    end
end

Contact us at files@mathworks.com