w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
identify the row in my time vector where the time is 5 seconds before the last printed time, times are however in milliseconds

For your sample vector (let's call it t):

find(t < t(end) - 5000, 1, 'last')
ans = 4

For the full matrix, it's almost the same thing:

find(matrix(:,2) < matrix(end,2) - 5000, 1, 'last')




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.