pwd ans = \\nask.man.ac.uk\home$\MATLAB which radon C:\Program Files\MATLAB\R2012a\toolbox\images\images\radon.m doc radon which siddon \\nask.man.ac.uk\home$\MATLAB\siddon.m I = phantom(30); doc phantom size(I) ans = 30 30 imagesc(I) [rays, sino] = siddon(I); h = 0.7658 ind = find(sum(rays,2)); A = rays(ind,:); b = sino(:); b = b(ind); imagesc(sino) x= A\b; figure;imagesc(reshape(x,30,30)) I=zeros(30,30); I(10,7) =1; imagesc(I) b= A*I(:); size(sino) ans = 41 60 size(b) ans = 2456 1 imagesc(reshape(b,41,60)) {Error using reshape To RESHAPE the number of elements must not change. } [rays, sino] = siddon(I); h = 0.7658 A = rays(ind,:); b = sino(:); b = b(ind); imagesc(sino) x= A\b; figure;imagesc(reshape(x,30,30)) figure;imagesc(reshape(A\(b + 0.1*randn(size(b))) ,30,30)) scale {Undefined function or variable 'scale'. } x=reshape(A\(b + 0.1*randn(size(b)),30,30)); x=reshape(A\(b + 0.1*randn(size(b)),30,30)); | {Error: Expression or statement is incorrect--possibly unbalanced (, {, or [. } x=reshape(A\(b + 0.1*randn(size(b))),30,30); plot(x(10,:)) figure;imagesc(reshape(A\(b + 0.5*randn(size(b))) ,30,30)) figure;imagesc(reshape(A\(b + 0.3*randn(size(b))) ,30,30)) cond(A) {Warning: Using CONDEST instead of COND for sparse matrix.} {> In cond at 28} {Error using condest (line 43) Matrix must be square. Error in cond (line 29) c = condest(A); } cond(full(A)) ans = 33.5029 bnoise = b + 0.1*randn(size(b)); % keep this as randn makes different answers each time it is called. a=0.1; figure; imagesc( reshape((A'*A + a^2*eye( size(A,2) ))\A'*bnoise,30,30) a=0.1; figure; imagesc( reshape((A'*A + a^2*eye( size(A,2) ))\A'*bnoise,30,30) | {Error: Expression or statement is incorrect--possibly unbalanced (, {, or [. } a=0.1; figure; imagesc( reshape((A'*A + a^2*eye( size(A,2) ))\A'*bnoise,30,30)) a=0.2; figure; imagesc( reshape((A'*A + a^2*eye( size(A,2) ))\A'*bnoise,30,30)) a=0.3; figure; imagesc( reshape((A'*A + a^2*eye( size(A,2) ))\A'*bnoise,30,30)) a=1; figure; imagesc( reshape((A'*A + a^2*eye( size(A,2) ))\A'*bnoise,30,30)) a=10; figure; imagesc( reshape((A'*A + a^2*eye( size(A,2) ))\A'*bnoise,30,30)) a=50; figure; imagesc( reshape((A'*A + a^2*eye( size(A,2) ))\A'*bnoise,30,30)) doc svd s=svd(A); {Error using svd Use svds for sparse singular values and vectors. } s=svd(full(A)); plot(s) loglog(s) semilogy(s) [U,S,V]=svd(full(A)); size(U) ans = 2456 2456 size(V) ans = 900 900 v1=V(:,1);imagesc(reshape(v1,30,30)) v1=V(:,30);imagesc(reshape(v1,30,30)) v1=V(:,500);imagesc(reshape(v1,30,30)) s(500) ans = 6.7159 exit