Text file as follows:
- A column: Year (1998:1:2017)
- B column: Day of the year (1:1:365 or 366)
- C column: Hour
1998 152 1 30 25 12.51998 152 1 30 30 121998 152 1 30 35 11.81998 152 1 30 40 11.91998 152 1 30 45 12
I would like to get data but I have problem for leap year of 366 days. I'd like to extract all rows and then write data to text file, which is D= 30 and E=25 and B>=152 and B<=243 but it changes B>=153 and B<=244 according to leap years. I tried something but I got 0 and 1. How can I write text file what I want?
load fulltable.txt;yearlenght = 365+(eomday(fulltable(:,1),2) == 29);if fulltable(:,1) == yearlenght; test = fulltable(fulltable(:,2)>=153 & fulltable(:,2)<=244 & fulltable(:,4)==30 & fulltable(:,5)==25,:);else fulltable(:,1) ~= yearlenght; test = fulltable(fulltable(:,2)>=152 & fulltable(:,2)<=243 & fulltable(:,4)==30 & fulltable(:,5)==25,:);end
Best Answer