Realize Simulink block "Ideal ADC Quantizer" in Matlab
Resolved.
The problem was in erroneous quantization.
Here is the correct quantization code:

% Quantization
dy = (2*A)/(2^res-1);
partition = (-A+A/2^res:dy:A-A/2^res);
codebook = (0:2^res-1);
[index,yq] = quantiz(y,partition,codebook);
yq = 2*A*yq/(2^res-1)-A;


where:

y - SIN waveform values

A - amplitude of SIN waveform

res - resolution of quantizer