Jump to content

Price fraction: Difference between revisions

(→‎{{header|Matlab}} / {{header|Octave}}: Price fraction - rescale)
Line 974:
{.86, x < .81}, {.90, x < .86}, {.94, x < .91}, {.98, x < .96}}, 1]</lang>
 
 
=={{header|MATLAB}} / {{header|Octave}}==
 
<lang Matlab> function y = rescale(x)
L = [0,.06:.05:1.02];
V = [.1,.18,.26,.32,.38,.44,.50,.54,.58,.62,.66,.70,.74,.78,.82,.86,.9,.94,.98,1];
 
y = x;
for k=1:numel(x);
y(k) = V(sum(L<=x(k)));
end;
end;
 
t=0:0.001:1;
plot(t,rescale(t)); </lang>
 
=={{header|Mercury}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.