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

📄 editimag.m

📁 线性代数实验及MATLAB入门,电子工业出版社出版 陈怀琛 龚杰民合著
💻 M
字号:
function A=editimag(B,imag,back)

% EDITIMAG   Edit an image created with MAKEIMAG.
%            The command (B,imag,back) edits the image
%            represented by the matrix B that was originally
%            created using the M-file makeimag. The input
%            arguments imag and back specify the image and
%            background colors based on the current colormap.
%            Click on a square to toggle between the background
%            color and the image color. Type q to quit.
%
%            Default colors are used if imag and back are not 
%            specified as input arguments.
%
%    Larry Riddle, ATLAST Workshop, San Diego, June 1994
%    Modified by S.J. Leon, May 1996

subplot(1,1,1)
[n,m]=size(B);
if nargin==1,imag=27;back=1;end
if nargin==2,back=1;end
A=B;
image(A); axis('square')
while 1
   [x y z]=ginput(1);
   if abs(z)=='q'
      break
   elseif (x>=1) & (x<n+1) & (y>=1) & (y<n+1)
      x=fix(x); y=fix(y);
      if A(y,x)~=imag
         A(y,x)=imag;
      else
         A(y,x)=back;
      end
      image(A); axis('square')
   end
end
close

⌨️ 快捷键说明

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