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

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by