RosettaCodeData/Task/Price-fraction/MATLAB/price-fraction.m
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

13 lines
268 B
Mathematica

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));