How to extract specific data from a matrix?

148 views (last 30 days)
Hi there,
I have a 100001x7 matrix that contains data, the first column is time and the other columns contain the values of some time-dependent functions at each time point. I would like to disregard the first 50000 rows and only look at the last part of the matrix in order to create a graph analyzing the period of one of the functions in Matlab. Could someone give me advice on how to do this? I know how to use ftt to analyse the period over all time points but not sure how to restrict it to just the last part.
Thanks, Scott.

Accepted Answer

Stephen23
Stephen23 on 19 Jun 2015
Edited: Stephen23 on 19 Jun 2015
You can use indexing to access any subset of an array:
>> X = rand(100001,7); % whole matrix
>> Y = X(50001:end,:); % from row 50001 to the last row
This is covered in MATLAB's introductory tutorials:

More Answers (0)

Community Treasure Hunt

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

Start Hunting!