Commit c14e06f7 authored by Pierre Cazenave's avatar Pierre Cazenave

Add support for even numbers of levels.

parent 7dc8cf88
......@@ -34,10 +34,10 @@ if p_sigma == 1
dist(k) = -((k-1)/(kb-1))^p_sigma;
end
else
for k = 1:(kb+1)/2
for k = 1:floor((kb+1)/2)
dist(k) = -((k-1)/((kb+1)/2-1))^p_sigma/2;
end
for k = (kb+1)/2+1:kb
for k = floor((kb+1)/2)+1:kb
dist(k) = ((kb-k)/((kb+1)/2-1))^p_sigma/2-1.0;
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment