Extracting a subset data from column 2 based on column 1

2 vues (au cours des 30 derniers jours)
Marcella Roth
Marcella Roth le 10 Fév 2021
Commenté : Iuliu Ardelean le 10 Fév 2021
Hi, I'm trying to extract a subset of data from column 2 that corresponds with column 1. For example, I need to extract values in column 2 that correspond to the values 40-70 in column 1. Column 1 is the time and Column 2 is the magnitude. I want to extract the magnitude for a certain time set.
Thanks!

Réponse acceptée

Iuliu Ardelean
Iuliu Ardelean le 10 Fév 2021
Hey
I assume your data looks something like this:
time = 1:100;
magnitude = rand(1,100);
selection = magnitude(time>40 & time<70);
  2 commentaires
Marcella Roth
Marcella Roth le 10 Fév 2021
Thank you, this works!
Iuliu Ardelean
Iuliu Ardelean le 10 Fév 2021
Welcome

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Octave 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