Borrar filtros
Borrar filtros

How to take values from a data corresponding to specific value

1 visualización (últimos 30 días)
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.

Respuesta aceptada

KSSV
KSSV el 8 de Jun. de 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) ;

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by