MATLAB Answers

## 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

### dina mohamed (view profile)

on 10 Apr 2018
Latest activity Edited by Walter Roberson

### Walter Roberson (view profile)

on 12 Aug 2018
Accepted Answer by KSSV

### KSSV (view profile)

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.

## 1 Answer

Answer by KSSV

### KSSV (view profile)

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) ;

dina mohamed

### dina mohamed (view profile)

on 11 Apr 2018
it is unfortunately work is not there any other method to read data at specified time ?
KSSV

### KSSV (view profile)

on 12 Apr 2018
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.