Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
%Function to concatenate and normalize Cluster Based Ensemble Data
function [CBEoriginal] = CBE()
%Load Cluster based ensemble .csv files
numOfFiles = 25;
csvfile = cell(1, numOfFiles);
for k = 1:numOfFiles
filename = sprintf('CBE/24HR_CBE_%d.csv', k);
csvfile{k} = filename;
end
%Concatenate the files into one
CBEdata = zeros(398, 698, 25); % allocate space in memory for array
for idx = 1:25
CBEdata(:,:,idx) = readmatrix(csvfile{idx}); % read new data into dimension 3
end
%swap dimensions in the 3D matrix so it matches that of the simple ensemble
CBEnew = reshape(CBEdata,[698 398 25]);
%The CBE values were normalized durring the calculations in order to return
%the same scale i need to multiply the CBE values by 1.0497548e-07, then add 2.9458301e-08
CBEorig = bsxfun(@times, CBEnew, 1.0497548e-07);
CBEoriginal = bsxfun(@plus, CBEorig, 2.9458301e-08);
end