mirror of
https://github.com/MillironX/beefblup.git
synced 2025-01-03 04:32:08 -05:00
Setup fixed-effect matrix
This commit is contained in:
parent
3d642e39ef
commit
a87417aedd
1 changed files with 10 additions and 0 deletions
|
@ -96,6 +96,9 @@ disp(' ')
|
||||||
X = zeros(numanimals, sum(numgroups)-length(numgroups)+1);
|
X = zeros(numanimals, sum(numgroups)-length(numgroups)+1);
|
||||||
X(:,1) = ones(1, numanimals);
|
X(:,1) = ones(1, numanimals);
|
||||||
|
|
||||||
|
% Create an external counter that will increment through both loops
|
||||||
|
I = 2;
|
||||||
|
|
||||||
% Iterate through each group
|
% Iterate through each group
|
||||||
for i = 1:length(normal)
|
for i = 1:length(normal)
|
||||||
% Find the traits that are present in this trait
|
% Find the traits that are present in this trait
|
||||||
|
@ -104,4 +107,11 @@ for i = 1:length(normal)
|
||||||
% Remove the "normal" version from the analysis
|
% Remove the "normal" version from the analysis
|
||||||
normalindex = find(strcmp(traits, normal{i}));
|
normalindex = find(strcmp(traits, normal{i}));
|
||||||
traits(normalindex) = [];
|
traits(normalindex) = [];
|
||||||
|
|
||||||
|
% Iterate inside of the group
|
||||||
|
for j = 1:length(traits)
|
||||||
|
matchedindex = find(strcmp(data(:,i+5), traits{j}));
|
||||||
|
X(matchedindex, I) = 1;
|
||||||
|
I = I + 1;
|
||||||
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue