How can it be that a value shown in a plot cannot be found in the matrix whose values are used to generate the plot?

1 次查看(过去 30 天)
Consider a plot of a frequency spectrum:
plot(f, X_dBm);
This plot has a peak at a frequency f_peak = 11 GHz. The amplitude in dBm = -6 dBm. You can click on the peak of the plot and it shows exactly these values for x and y. X_dBm is a matrix of t rows and n columns. I plot column n=30. When I search for the entry -6 the result is 0. How can that be? I am using:
find(X_dBm(:,30) = -6)

采纳的回答

Image Analyst
Image Analyst 2016-12-26
编辑:Image Analyst 2016-12-26
To fix:
oneColumn = X_dBm(:,30);
targetValue = -6;
tolerance = .01; % or whatever closeness you want.
rows = find(abs(oneColumn - targetValue) <= tolerance);

更多回答(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