DAY 4
guide
handles.peaks=peaks(35);
handles.membrane=membrane;
[x,y]=meshgrid(-8:.5:8);
r=sqrt(x.2+y.2)+eps;
sinc=sin®./r;
handles.sinc=sinc;
handles.current_data=handles.peaks;
surf(handles.axes1,handles.current_data)
set and get
a=get(handles.slider1,'Value); % 局部变量
set(handles.texts,‘String’,‘TEST’);
% 将a变为 全局变量
%store variable
handles.myData=a;
guidata(hObject,handles); % 固定格式
% retrieve variable
a=handles.myData;
deploytool
digital image
read and show an image
imread()
imshow()
i=imread(‘pout.tif’);
imshow(i);
imtool(‘pout.tif’)
image processing
immultiply()
I=imread(‘rice.png’);
subplot(1,2,1);imshow(I);
J=immultiply(I,1.5); % 每个影像都乘1.5
subplot(1,2,2);imshow(J);
imadd()
I=imread(‘rice.png’);
J=imread(‘cameraman.tif’);
K=imadd(I,J);
subplot(1,3,1);
imshow(I);
subplot(1,3,2);
imshow(J);
subplot(1,3,3);
imshow(K)
imhist()
imhist(I)
geometric transformation
imrotata()
I=imread(‘rice.png’);
subplot(1,2,1);
imshow(I);
J=imrotate(I,35,‘bilinear’);
subplot(1,2,2);
imshow(J);
size(I);
size(J);
imwrite()
imwrite(I,‘pout2.png’);