%These are the initialization steps for the Lorenz_96 model %apply perturbation to truth and create ensembles truth(20)=truth(20)+initial_model_perturbation; for j=1:ensemblesize ensemble(20,j)=ensemble(20,j)+initial_model_perturbation+randn*initial_ensemble_perturbation; end %create a matrix of indices index=[1:modelresolution]; indices=[index+1;index-2;index-1]; indices=mod(indices,modelresolution); indices(find(indices==0))=modelresolution; %setup lorenz_96 model deriv=inline('(x1-x2).*x3-x4+forcing');