How to extract specific data from a matrix?

9 vues (au cours des 30 derniers jours)
Scott Dallas
Scott Dallas le 19 Juin 2015
Modifié(e) : Stephen23 le 19 Juin 2015
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.

Réponse acceptée

Stephen23
Stephen23 le 19 Juin 2015
Modifié(e) : Stephen23 le 19 Juin 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:

Plus de réponses (0)

Catégories

En savoir plus sur Networks dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by