I just updated my code which may give you a bit clear picture.
R=zeros(365,30); % Space for the data
P_data=P(:,4); % Preciptation data
n=length(P_data);
C=1;
W_days=0;
for i=1:30;
for j=1:365;
R(j,i)=P_data(C);
C=C+1;
end
if R(j,i)>0;
W_days=W_days+1;
end
prob(j)=W_days/30; % probability of wet days
end
plot(1:365,prob)