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