Finding Data in a loaded file
古いコメントを表示
I am having a data file with amplitudes mentioned in it almost 10000 samples are present and I know value of one amplitude which is present in the data and want to find location of that sample how to do that ?
採用された回答
その他の回答 (1 件)
KSSV
2019 年 7 月 10 日
Let A be your data and you want to seek b from it.
idx = find(abs(A-b)<10^-5)
3 件のコメント
Rohan Mehta
2019 年 7 月 10 日
KSSV
2019 年 7 月 10 日
It is a tolerance set, to check the equality of both numbers. This is how the floating numbers are checked.
Guillaume
2019 年 7 月 10 日
10^-5 is better written as 1e-5 (1e-5 does not involve any runtime computation).
It must be pointed out that the comparison tolerance must be chosen in accordance to the magnitude of the numbers being compared. 1e-5 would be completely inapproriate if the magnitude of the numbers being compared is in the order of 1e-10.
For that reason, ismembertol would be better as it automatically calculate the appropriate tolerance for you.
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!