-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathComputeDamagePercentiles.m
More file actions
27 lines (16 loc) · 994 Bytes
/
ComputeDamagePercentiles.m
File metadata and controls
27 lines (16 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function [ damagePercentiles, deltaGMSL, naturalSL, historicalSL ] = ComputeDamagePercentiles( sandyTable, naturalCalibrationStruct, historicalCalibrationStruct, percentiles, stagger )
%UNTITLED12 Summary of this function goes here
% Detailed explanation goes here
naturalSLMatrix = naturalCalibrationStruct.sl;
naturalYears = naturalCalibrationStruct.time;
historicalSLMatrix = historicalCalibrationStruct.sl;
historicalYears = historicalCalibrationStruct.time;
yearOfInterest=2012;
naturalColsIndicesOfInterest = naturalYears == yearOfInterest;
historicalColsIndicesOfInterest = historicalYears == yearOfInterest;
naturalSL = naturalSLMatrix(:,naturalColsIndicesOfInterest);
historicalSL = historicalSLMatrix(:,historicalColsIndicesOfInterest);
deltaGMSL = (naturalSL - historicalSL) ./ 100;
damages = SandyDamagesGivenDeltaGMSL(sandyTable, deltaGMSL);
damagePercentiles = prctile(damages, 100-percentiles, 2);
end