Plotting results of fft2 with frequencies in the x and y axes

조회 수: 1 (최근 30일)
savitha muthanna
savitha muthanna 2021년 5월 8일
편집: Matt J 2021년 5월 8일
I have the results of the position and momenta of particles, in the matrix y1, from (1:N,1:N) for positions and (1:N,N:2N) of momentum. IT represents time.
-------------------------------------------
for IT=1:(t/L),
yq(IT, 1:N,1:N)=y1(IT,1:N,1:N);
yp(IT, 1:N,1:N)=y1(IT,1:N, N+1,2*N);
YQ=fft2(yq(IT,:,:));
YP=fft2(yp(IT, :,:));
end
----------------------------------------------
I took fft2 to compute the spectrum for the positions and momenta and now I want to plot them. I tried the following,:
rYQ(IT,:,:)=abs(fftshift(YQ));
sYQ(IT,:,:)=rYQ(IT,:,:) ./ max(rYQ(IT,:,:));
surf(rYQ(IT,:,:));
Is the above correct? In addition, I get an error saying :
Error using surf (line 71)
Z must be a matrix, not a scalar or vector.
Please help.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by