MATLAB Answers

Extracting a subset data from column 2 based on column 1

3 ビュー (過去 30 日間)
Marcella Roth
Marcella Roth 2021 年 2 月 10 日
コメント済み: Iuliu Ardelean 2021 年 2 月 10 日
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!

採用された回答

Iuliu Ardelean
Iuliu Ardelean 2021 年 2 月 10 日
Hey
I assume your data looks something like this:
time = 1:100;
magnitude = rand(1,100);
selection = magnitude(time>40 & time<70);
  2 件のコメント
Iuliu Ardelean
Iuliu Ardelean 2021 年 2 月 10 日
Welcome

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by