フィルターのクリア

How to take values from a data corresponding to specific value

1 回表示 (過去 30 日間)
Murad Nuri
Murad Nuri 2020 年 6 月 8 日
コメント済み: Murad Nuri 2020 年 6 月 8 日
I have a 400:2 txt. data. A value corresponding to 0.3 is 1.5373. How can I call the value of 1.5373 from the txt. data by putting 0.3 in the command board?
Please,anybody help me.

採用された回答

KSSV
KSSV 2020 年 6 月 8 日
Read about interp1. You can use interpolation and get it.
Also you can use logical indexing. But I prefer interp1. Let A be your 400*2 data.
x = A(:,1) ; y = A(:,2) ;
% Using interp1
xi = 0.3 ;
yi = intepr1(x,y,xi)
% using indices
xi = 0.3 ;
idx = find(abs(x-xi)<10^-3);
yi = x(idx) ;
  1 件のコメント
Murad Nuri
Murad Nuri 2020 年 6 月 8 日
yeah, worked perfectly. Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by