Problem with Frequency distribution plot

조회 수: 1 (최근 30일)
AkB
AkB 2023년 4월 12일
편집: Torsten 2023년 4월 13일
I have a scatter plot in (x, z). I need to plot a frequency distribution of z-values as a function of x. Please suggest.
  댓글 수: 4
Image Analyst
Image Analyst 2023년 4월 13일
This is a poorly worded question. Perhaps frequency distribution means histogram. I was thinking it was like a signal and he wanted the frequency spectrum of the signal. But it looks like @AkB is ignoring our comments, so I'm not going to do anything more until we hear back from @AkB with a clearer explanation of what the context/situation is.
Torsten
Torsten 2023년 4월 13일
편집: Torsten 2023년 4월 13일
I think he/she is unsure about it himself/herself.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2023년 4월 12일
If x is not uniformly spaced then use interp1 or spline to get x and z uniformly spaced. Then call fft(z).
ft = fft(z);
plot(abs(ft), 'b-');

Community Treasure Hunt

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

Start Hunting!

Translated by