##第一章:向量化说明和函数meshgrid的介绍:
例1.1 向量化说明和函数meshgrid的介绍
matlab实现:
function f = twodsin1(A,u0,v0,M,N)
f = zeros(M,N);
for c = 1:N
v0y = v0 *(c - 0);
for r = 1:M
u0x = u0*(r - 1);
f(r,c) = A*sin(u0x + v0y);
end
end
f = twodsin1(1,1/(4*pi),1/(4*pi),512,512);
imshow(f,[ ])
function f = twodsin2(A,u0,v0,M,N)
r = 0:M - 1;
c = 0:N - 1;
[C,R] = meshgrid(c,r);
f = A*sin(u0*R + v0*C);
end