MATLAB Answers

0

how can i select data at time series at secified time 0.4 when time between 0:0.5 i want to select data in this time 0.4

Asked by dina mohamed on 10 Apr 2018
Latest activity Edited by Walter Roberson
on 12 Aug 2018 at 20:12

how can i select data at time series at secified time 0.4 when time between (0:0.5)s i want to select data in this time 0.4 s

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by KSSV
on 11 Apr 2018
 Accepted Answer

Read about interp1. You can do interpolation and pick the value where you want. Let t and a be your data. If you want value at 4:

val_at_4 = interp1(t,val,4) ;

  2 Comments

it is unfortunately work is not there any other method to read data at specified time ?

You can get the index of the time step...and extract the respective value.

idx = find(t==4) ;
val(idx)

As the time is flottant, it is suggested to use:

tol = 10^-3 ;
idx = find(abs(t-4)<=tol) ;
val(idx)

Sign in to comment.