Find the date for extracted values

1 view (last 30 days)
SBinary
SBinary on 24 Sep 2013
I have a file - 1 row and 10 956 columns, with precipitation measurements and have managed to extract the times the precipitations is higher than 20mm for more or equal to 2 days in a row and has stored those values in different matrices for each time it has happened - eg. [21, 37, 27], [23, 38] each in different columns. In another file I have the dates (for 1961-1990) - [year, month, day, and then three more columns, which are not used, filled with 0s] and I would like to see which dates correspond to the extracted precipitation values above. Does anyone know how to do this?
  2 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 24 Sep 2013
You can make your question more clear with a short numeric example
SBinary
SBinary on 24 Sep 2013
Thank you for your answer, I will try.
I have precipitation values [1, 0, 0, 23, 1, 21, 37, 27, 2, 23, 38] and a date file [ 1960, 01, 01; 1960, 01, 02; 1960, 01...; 1960, 01, 11].
What I have done so far is by using the following code,
i=diff([0 data>=20 0]);
i1=find(i==1);
i9=find(i==-1);
l=(i9-i1);
b=l>=2;
i1=i1(b);
i9=i9(b)-1;
c=arrayfun(@(i1,i9) data(i1:i9), i1, i9, 'unif', 0);
c{:}
extract and store, in separate matrices, the values for consecutive days with more or equal to 20mm precipitation - i.e. [21, 37, 27], [23, 38]. What I would like to do now is to connect these extracted values to dates. Does this make it more clear?

Sign in to comment.

Answers (0)

Categories

Find more on Weather and Atmospheric Science in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!