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

📄 difplot.m

📁 斑纹噪声消除
💻 M
字号:
function difplot(x, time, step, tit, fig, varargin)
%  DIFPLOT    Plots the diffused image
%
%     DIFPLOT(x, time, step, tit, fig) plots the image "x" at the
%     subplot(1,2,2) of figure "fig". "tit" specifies the plot title.
%     "time" and "step" are the diffusion time and diffusion step show
%     as the xlabel of the plot.
%     DIFPLOT(..., 'imscale') plots the image using imagesc(x) intead
%     of image(x).

[imscale] = parse_inputs(varargin{:});

figure(fig);
subplot(1,2,2);

if ndims(x) == 3
   image(scale(x,[0 1]))
else
   if imscale
      imagesc(x);
      colorbar
   else
      image(x);
   end
end
xlabel(['Time =  ', num2str(time),',  Step = ', int2str(step)]);
title(tit);
drawnow;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [imscale] = parse_inputs(varargin)

flag = zeros(1,nargin); % zero = par. nao usado / 1 = param . usado

imscale = 0;
for i = 1 : length(varargin)
   if strcmp(varargin(i), 'imscale')
      imscale = 1;
      flag(1,i) = 1;
   end
   if strcmp(varargin(i), 'null')
      flag(1,i) = -1;
   end
end

if any(flag==0)
   error('Unknown parameter.')
end

⌨️ 快捷键说明

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