From 9ecc9b1bacf2028c6907019cfd460573dae5fbac Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Mon, 17 Sep 2018 09:00:21 -0600 Subject: [PATCH] Define "normal" animals --- MATLAB/beefblup.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MATLAB/beefblup.m b/MATLAB/beefblup.m index dbf7cca..e1bbedb 100644 --- a/MATLAB/beefblup.m +++ b/MATLAB/beefblup.m @@ -67,3 +67,14 @@ if sum(numgroups) >= numanimals return end +% Define a "normal" animal as one of the last in the groups, provided that +% all traits do not have null values +normal = cell([1 length(headers)-5]); +for i = 6:length(headers) + for j = numanimals:-1:1 + if not(cellfun(@isempty, data(j,i))) + normal(i - 5) = data(j,i); + continue + end + end +end \ No newline at end of file