water_level.m

clear all; clc; 
figure(1), clf; 
 
data    =   load('waterstand_HOH.txt');   % loading water levels 
afmeting    =   size(data); 
som    =   afmeting(:,1);  % size of the dataset 
replace    =   true;  % Bootstrap with replacing 
jaar    =   98;  % Number of years over which    
         the dataset is created 
Y    =   sort(data);  
N    =   histc(data,Y); 
Y(N==0)    =   []; 
N(N==0)    =   []; 
sizeN    =   size(N); 
k    =   sizeN(:,1) 
 
for i = 1:k 
    data_orig(i)  =   sum(N(i:k)); 
end 
 
CumHOH_orig  =   data_orig';  
Levels_orig   =   Y; 
CumHOH_aantal_orig =  CumHOH_orig/jaar;  
 
for n = 1:k 
    CumHOH_jaar_orig(n) = 1/CumHOH_aantal_orig(n);  
end 
 
CumHOH_jaar_rot_orig =   CumHOH_jaar_orig';  % Cumulative probabilities of  
        HOH water levels 
for z = 1:1000    % Bootstrap 
    data  =   0; 
    CumHOH_jaar   =   0; 
    CumHOH_jaar_r
上一篇:【leetcode_easy_greedy】1518. Water Bottles


下一篇:力扣-11盛最多水的容器 Container with most water