Find the date for extracted values

1 次查看(过去 30 天)
SBinary
SBinary 2013-9-24
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 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2013-9-24
You can make your question more clear with a short numeric example
SBinary
SBinary 2013-9-24
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?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Weather and Atmospheric Science 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by