我的一些工作傅立葉在MATLAB代碼轉換這個MATLAB代碼,以及所遇到的以下內容:歸納對非方陣
xx = meshgrid(1:N);
% Center on DC
xx = xx - dcN;
% normalize dynamic range from -1 to 1
xx = xx./max(abs(xx(:)));
% form y coordinate from negative transpose of x coordinate (maintains symmetry about DC)
yy = -xx';
% compute the related radius of the x/y coordinates centered on DC
rr = sqrt(xx.^2 + yy.^2);
我怎麼能概括這對於非方陣?此代碼假設我的矩陣是平方的,所以dcN是方陣的中心(換句話說,11x11,dcN = 6)。
當轉置用於非方形矩陣時,數學並不適用於該yy變量。
我試圖弄清楚,如果我可以使一個meshgrid從「從上到下」而不是從左到右 - 但我還沒有能夠計算出任何一個。
感謝