fg_01_03.m

来自「英文书《Digital Signal Processing with Examp」· M 代码 · 共 32 行

M
32
字号
% fg_01_03    Chapter 1, fig. 1.3.
% There are 2 images here. Run s for first image; q for second.
s=[0 1 2 3 1;...
   2 3 0 1 2;...
   3 2 1 0 1;...
   0 1 2 3 1;...
   2 3 0 2 0];
q=[5 5 5 5 5;...
   4 4 4 4 4;...
   3 3 3 3 3;...
   2 2 2 2 2;...
   1 1 1 1 1];
y=q.*s
colormap(gray(16));
brighten(.2);
sp_fig(1);
% Original image.
axes('position',[.1,.4,.5,.5]);
image(5*s+1);
set(gca,'position',[.05,.4,.5,.5]);
axis('square')
set(gca,'Ytick',[1 2 3 4 5])
set(gca,'fontname','times','fontsize',18);
title('Original (S)');
% Faded image.
axes('position',[.55,.4,.5,.5]);
image(y+1);
axis('square')
set(gca,'Ytick',[1 2 3 4 5])
set(gca,'fontname','times','fontsize',18);
title('Faded (Q.*S)');

⌨️ 快捷键说明

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