forked from ldominguezruben/meanderstatisticstoolbox
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmStat_ExportExcel.m
83 lines (62 loc) · 2.91 KB
/
mStat_ExportExcel.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
function mStat_ExportExcel(geovar)
%This function save all the data in excel file to posprocessing
[file,path] = uiputfile('*.xlsx','Save *.xlsx file');
outfile = fullfile(path,file);
str=['Exporting' file];
hwait = waitbar(0,str,'Name','MStaT');
[m,n]=size(geovar.equallySpacedX);
D='DS';
U='US';
C='C';
D=sum(strcmp(D,geovar.condition));
U=sum(strcmp(U,geovar.condition));
C=sum(strcmp(C,geovar.condition));
sout = {...
'MStaT: Summary of Data Analysis' '' '' '' '' '';...
'Date Processed: ' datestr(now) '' '' '' '';...
'Path and File' '' '' '' '' outfile;
'' '' '' '' '' '';...
'Statistics points Analysis' '' '' '' '' '';...
'Total Bends found:' '' '' '' '' geovar.nBends;...
'Total Length [m]:' '' '' '' '' geovar.intS(end,1);...
'Total points analyzed:' '' '' '' '' m;...
'' '' '' '' '' '';...
'Method' '' '' '' '' geovar.methodIntersection;
'Numbers of Downstream Bends found' '' '' '' '' D;...
'Numbers of Upstream Bends found' '' '' '' '' U;...
'Numbers of C Bends found' '' '' '' '' C;...
'' '' '' '' '' '';...
'' '' '' '' 'Min' 'Max';...
'Amplitude [m]' '' '' '' nanmin(geovar.amplitudeOfBends) nanmax(geovar.amplitudeOfBends);...
'Sinuosity [m]' '' '' '' nanmin(geovar.sinuosityOfBends) nanmax(geovar.sinuosityOfBends);...
'Wavelength [m]' '' '' '' nanmin(geovar.wavelengthOfBends) nanmax(geovar.wavelengthOfBends)};
xlswrite(outfile,sout,'MStaTSummary','A1');
waitbar(1/5,hwait)
s1=[num2cell([geovar.bendID1' geovar.sinuosityOfBends geovar.lengthCurved'...
geovar.wavelengthOfBends geovar.amplitudeOfBends geovar.downstreamSlength' geovar.upstreamSlength'])];
s1headers = {'BendID' 'Sinuosity_Of_Bends' 'Arc_Wavelength_[m]'...
'Wavelength_[m]' 'Amplitude_Of_Bends_[m]' ...
'Downstream_length_[m]' 'Upstream_length_[m]'};
pvout1 = vertcat(s1headers,s1);
xlswrite(outfile,pvout1, 'Planar Variables');
waitbar(2/5,hwait)
s2=[num2cell([geovar.equallySpacedX geovar.equallySpacedY...
geovar.xValleyCenter geovar.yValleyCenter ...
geovar.sResample geovar.cResample])];
s2headers = {'Equally_SpacedX_[m]' 'Equally_SpacedY_[m]' 'xValley_Center_[m]'...
'yValley_Center_[m]' 'S_Resample' 'C_Resample'};
pvout2 = vertcat(s2headers,s2);
xlswrite(outfile,pvout2, 'Geometry');
waitbar(3/5,hwait)
s3=[num2cell([geovar.newMaxCurvX geovar.newMaxCurvY...
geovar.newMaxCurvS])];
s3headers = {'NewMaxCurvX_[m]' 'NewMaxCurvY_[m]' 'NewMaxCurvS_[m]'};
pvout3 = vertcat(s3headers,s3);
xlswrite(outfile,pvout3, 'Data');
s4=[num2cell([geovar.inflectionX...
geovar.inflectionY])];
s4headers = {'Inflection_X' 'Inflection_Y'};
pvout4 = vertcat(s4headers,s4);
xlswrite(outfile,pvout4, 'Inflection_points');
waitbar(1,hwait)
delete(hwait)