I have the following sample of data
Time(s) Speed(m/s)
1.2 7
2.5 4.2
2.6 8
3.1 12
3.6 3.2
3.9 9.1
4.3 1.6
4.6 3.8
I want to only have the data in the time range of 2-4 seconds. I can do this no problem with
Extracted_Time_Data = Data_Times(Data_Times>2 & Data_Times<4);
However I will only have the times and not the accompanying (in this case) speed value. I know I could use something like
Extracted_Speed_Data = Data(2:5,2);
which I could then use to make a matrix
End_Goal = [Extracted_Time_Data,Extracted_Speed_Data]
And I have answered my own question however what if I used another data set with hundreds of lines of data. I still want the data in the same time range 2-4 seconds
but I want MATLAB to automatically store the speed with its accompanying time.
I hope the question is clear enough, thanks in advance for any help given.