function C_m = kvantizacia_C(C_m, pq)
max_C = max(max(C_m));
min_C = min(min(C_m));

rozsah = max_C-min_C;
C_q = rozsah/(pq-1);
for ii = 1:pq-1
    C_m(C_m>min_C+C_q*(ii-1) & C_m<min_C+C_q*ii) = min_C+C_q*(ii-1);
end
u = unique(C_m)';
for i = u
    t = abs(min_C-i)/C_q;
    C_m(C_m == i) = round(t*1);
end
    
end