How to take values from a data corresponding to specific value
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Murad Nuri
am 8 Jun. 2020
Kommentiert: Murad Nuri
am 8 Jun. 2020
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.
0 Kommentare
Akzeptierte Antwort
KSSV
am 8 Jun. 2020
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) ;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multirate Signal Processing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!