Permalink
Cannot retrieve contributors at this time
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?
Big-Data/CBE.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
26 lines (21 sloc)
905 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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 |