-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatsHulls.m
More file actions
executable file
·25 lines (19 loc) · 1.01 KB
/
Copy pathstatsHulls.m
File metadata and controls
executable file
·25 lines (19 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function [struct] = statsHulls(struct)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% This function computes the convex hull for the data in matrix and other %
% relavant statistics to describe the data (number of points per unit of %
% of volume, coordinates of the centroid, ranges on each dimension, minima%
% and maxima, the variance-covariance matrix and the correlation matrix. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
struct.elements = length(struct.fitted(:,1));
[struct.K, struct.V] = convhulln(struct.fitted);
struct.density = struct.elements / struct.V;
struct.centroid = mean(struct.fitted);
struct.ranges = range(struct.fitted);
struct.minima = min(struct.fitted);
struct.maxima = max(struct.fitted);
struct.covariance = cov(struct.cleanData);
struct.corrMatrix = corr(struct.cleanData);
end