⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 picardtolplot.m

📁 curves ti si s a nice code.
💻 M
字号:
function tol = PicardTolPlot(A, b)%%             tol = PicardTolPlot(A, b);%%  Given a psfMatrix A, and a right hand side image b,%  this function plots the Picard condition, and allows%  the user to graphically choose a tolerance for use in%  the preconditioner.%%  J. Nagy  12/30/01P = psfPrec(A, b, 0);e = 1./P.matdata;e = abs(reshape(e', prod(size(e)), 1));[e, idx] = sort(e);e = flipud(e);b = reshape( fftn(b)', prod(size(b)), 1 );b = abs( flipud( b(idx) ) ) / sqrt(prod(size(b)));figure h = gcf;semilogy(e)hold onsemilogy(b, 'r')legend('Eigenvalues', 'Fourier coefficients')drawnowSmoothPlot = input('Smooth the Fourier coefficeints? [n] ', 's');if isempty(SmoothPlot)  SmoothPlot = 'n';endl = 1;while SmoothPlot == 'y'   hold off  figure(h)  semilogy(e)  hold on  semilogy(medfilt1(b,l*10), 'r')  legend('Eigenvalues', 'Fourier coefficients')  drawnow  if l > 5    break  end  SmoothPlot = input('Smooth the Fourier coefficeints? [n] ', 's');  if isempty(SmoothPlot)    SmoothPlot = 'n';  end  l = l + 1;enddisp(' ')disp('Use the mouse to locate where Fourier coefficients level off ')[k, y] = ginput(1);k = round(k);tol = e(k);plot(k, e(k), 'o')plot([k, k], [min(b), e(k)], 'k--')text(k, e(k), sprintf('  tol = %f', tol))NewPoint = input('Choose a different point? [n] ', 's');if isempty(NewPoint)  NewPoint = 'n';endwhile NewPoint == 'y'  figure(h)  disp('Use the mouse to locate where the Fourier coefficients level off')  [k, y] = ginput(1);  k = round(k);  tol = e(k);  plot(k, e(k), 'o')    plot([k,k], [min(b), e(k)], 'k--')  text(k, e(k), sprintf('  tol = %f', tol))  NewPoint = input('Choose a different point? [n] ', 's');  if isempty(NewPoint)    NewPoint = 'n';  endend  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -