필터 지우기
필터 지우기

Check for missing entry in data points with certain rule

조회 수: 3 (최근 30일)
Poulomi Ganguli
Poulomi Ganguli 2017년 9월 6일
편집: Poulomi Ganguli 2017년 9월 6일
Hello,
I have a matrix of time series as attached, in which the first column is the year, 2nd month, 3rd is day, 4th and 5th columns are the values. Currently, I have attached a sample of only the year 1960, likewise I have years till 2000 with values. I want to check whether there is atleast 6-months of data entry and at least 20-days entries for each month. If this satisfy this rule certain calculation will be performed, otherwise it will move to next year. I tried the code in foll.way, however, it is giving me time series of only January instead of January to December.
[unqMonth,~,Month_ID] = unique(QYrly(:,2));
Monly = size(unqMonth,1)>=6; % Check for atleast 6-months of data entry
Dly = histc(QYrly(:,2),unqMonth)>=20; % Checks for atleast 20 days entries for each month
Qout = QYrly(ismember(Month_ID,find(Monly)) & ismember(Month_ID,find(Dly)),:);
Any help?
  댓글 수: 1
Poulomi Ganguli
Poulomi Ganguli 2017년 9월 6일
편집: Poulomi Ganguli 2017년 9월 6일
Ok I solved it using a simple loop:
if (Monly==1 & any(Dly ~= 0))
QOut = QYrly;
else QOut = [];
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by