Skip to content

Commit

Permalink
Avoided the use of combvec or allcomb in Octave
Browse files Browse the repository at this point in the history
  • Loading branch information
pagutierrez committed Nov 14, 2017
1 parent b7f284a commit 2c729f7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Experiment.m
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,17 @@
aux1 = combinations;
end
aux2 = getfield(parameters, par{i+1});
dimensions = cellfun(@numel, {aux1,aux2});
dimensions = cellfun(@length, {aux1,aux2});
[i1,i2] = ind2sub(dimensions, 1:prod(dimensions));
combinations = [aux1(i1); aux2(i2)]';
end
if i==1,
combinations = [aux1(i1); aux2(i2)]';
else
combinations = [aux1(i1,:) aux2(i2)'];
end;
end
if numel(par) ~= 1
combinations = combinations';
end
else
for i=1:(numel(par)-1),
if i==1,
Expand Down

0 comments on commit 2c729f7

Please sign in to comment.