谢谢,我的意思是fft2(u)中u怎么去定义,也就是下面这个程序中二维函数怎么去定义,这个程序运行结果不对,但我不知道问题出在哪,请多多指教n1=100;n2=100;
for x=1:2*n1
for y=1:2*n2
test(x,y)=exp(sin(2*(x-1)*pi/n1+3*(y-1)*pi/n2));%定义函数
testdx(x,y)=2*cos(2*(x-1)*pi/n1).*exp(sin(2*(x-1)*pi/n1+3*(y-1)*pi/n2));%对函数求导
end
end
https://blog.csdn.net/qinqijing_123/article/details/5734554
在command窗口 help fft2 即可
谢谢,我的意思是fft2(u)中u怎么去定义,也就是下面这个程序中二维函数怎么去定义,这个程序运行结果不对,但我不知道问题出在哪,请多多指教n1=100;n2=100;
for x=1:2*n1
for y=1:2*n2
test(x,y)=exp(sin(2*(x-1)*pi/n1+3*(y-1)*pi/n2));%定义函数
testdx(x,y)=2*cos(2*(x-1)*pi/n1).*exp(sin(2*(x-1)*pi/n1+3*(y-1)*pi/n2));%对函数求导
end
end
testk=fft2(test,2*n1,2*n2);%对原函数进行fft2
k=[0:n1-1,-n1:-1];
fftk=repmat(k,200,1)
testdxk = fftk.*testk*i;
testdx2 = ifft2(testdxk,2*n1,2*n1);
,
我感觉是对的,也没检查出不对的地方啊