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

1 view (last 30 days)
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

Accepted Answer

dpb
dpb on 15 Oct 2014
>> 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 Comments
dpb
dpb on 16 Oct 2014
I presume she added it -- her hangup was selecting the subset of that data desired...

Sign in to comment.

More Answers (0)

Categories

Find more on Language Fundamentals in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!