How to separate data from two vectors where both vectors need to be over a threshold

1 回表示 (過去 30 日間)
Kristine
Kristine 2014 年 10 月 15 日
コメント済み: Kristine 2014 年 10 月 16 日
Hi.
I have two stations with hourly data and I would like to do a correlation of the two stations but only for the values above a certain threshold, like 35. How can I make a loop that takes all the values from station 1 and station 2 above 35 into a new vector. In other words, I want only values over 35 but I want my vectors to be the same length, so only values where both stations have higher values than 35.
Example of the data:
Time Station1 Station2
40179 111 33
40179 76 32
40179 28 27
40179 28 23
40179 20 21
40179 26 21
40179 25 24
40179 27 24
40179 18 24
40179 27 19
Thank you so much in advance for helping.
Best, Kristine

採用された回答

dpb
dpb 2014 年 10 月 15 日
>> ix=data(:,1)>22 & data(:,2)>22;
>> data(ix,:)
ans =
40179 111 33
40179 76 32
40179 28 27
40179 28 23
40179 26 21
40179 25 24
40179 27 24
40179 27 19
>>
I chose a different setpoint given the values in the posted set..
--
  4 件のコメント
dpb
dpb 2014 年 10 月 16 日
I presume she added it -- her hangup was selecting the subset of that data desired...
Kristine
Kristine 2014 年 10 月 16 日
Correct dpb :)

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by