MATLAB: Rain rate Calculating and plotting CCDF and percentage of time that the rain rate exceeded.

complementary cumulative distribution functions ccdf rain rate rainfall percentage of time that the rain rate exceededMATLAB

send it in excel if it is data. Other wise post its code. File not opening on my PC

Best Answer

data = importdata('RainRate.txt');
day = data(:,1);
mth = data(:,2);
yr = data(:,3);
time_hr = data(:,4);
time_min = data(:,5);
RainfallIntensity = data(:, 6);
N = length(RainfallIntensity)+1; %total duration, min
hist(RainfallIntensity);
[nelements,RainRate] = hist(RainfallIntensity,20); %count frequency of rainrate
Prob = nelements/N; %probability
%estimate cum- probability
Cum_prob(1) = Prob(1);
for i = 2:20
Cum_prob(i) = Cum_prob(i-1)+Prob(i);
end
loglog(1-Cum_prob, RainRate);