8 lines
130 B
Mathematica
8 lines
130 B
Mathematica
|
function [y,idx] = quantif(x,M,Delta)
|
||
|
|
||
|
idx = floor(x/Delta);
|
||
|
|
||
|
idx = max(idx,-M/2);
|
||
|
idx = min(idx,M/2-1);
|
||
|
|
||
|
y = idx*Delta + Delta/2;
|