You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sbeach_toolbox/fsbeach_collectresults.m

34 lines
960 B
Matlab

7 years ago
% SBEACH toolbox - fsbeach_collectresults
% Written by Joshua Simmons 11/2017
% Syntax:
% sbout = fsbeach_collectresults(sblocs)
%
% Input:
% sblocs = Cell array of locations where SBEACH has been run
% Output:
% sbout = structure with sbeach data;
function sbout = fsbeach_collectresults(sblocs)
for ii = 1:length(sblocs)
fid = fopen([sblocs{ii} '.Excel.ASSUPPLIED'],'r');
formatSpec = '%f %f %f';
sizeA = [3 Inf];
tempresults = fscanf(fid,formatSpec,sizeA)';
fclose(fid);
clear fid
%get computed profile
sbout.computed(ii).z(:,1) = tempresults(:,3);
sbout.computed(ii).x = tempresults(:,1);
%input bathy
sbout.input(ii).x = tempresults(:,1);
sbout.input(ii).z = tempresults(:,2);
%now get wave elevations etc
fid = fopen([sblocs{ii} '.XVR'],'r');
sbout.xvr(ii) = fsbeach_readxvrfile(fid);
end
end