forked from RegMeasures/XChannel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OutputBankPosTS.m
27 lines (22 loc) · 919 Bytes
/
OutputBankPosTS.m
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
27
% Post processing routine to loop through all results in outputs folder and
% output time series of bank position.
addpath Functions
OutputsFolder = 'Outputs\';
WL = 212.5;
Radius = 1;
Folders = struct2table(dir(OutputsFolder));
Folders = Folders.name(Folders.isdir);
Folders(ismember(Folders,{'.','..'})) = [];
Scenario = str2double(regexp(Folders,'\d+','match','once'));
[~,SortIndex] = sort(Scenario);
Folders = Folders(SortIndex);
for FolderNo = 1:size(Folders)
[BankPosition.ModelTime,BankPosition.(Folders{FolderNo,1})] = ...
BankPosTS(fullfile(OutputsFolder,Folders{FolderNo}, ...
['snapshots_',Folders{FolderNo}]), WL, Radius);
BankPosition.(Folders{FolderNo,1}) = ...
BankPosition.(Folders{FolderNo,1}) - ...
BankPosition.(Folders{FolderNo,1})(1);
end
BankPosition = struct2table(BankPosition);
writetable(BankPosition,'Outputs\BankPosition.csv')