📄 example01.m
字号:
function example01;
% out=randint(3,5,[-4,7])
% out=randsrc(3,5,[-3 -1 1 3;0.25 0.25 0.25 0.25])
% [index,quants,distor]=quantiz([3 34 84 40 23],10:10:90,10:10:100)
t=[0:0.1:2*pi];
s=sin(t);
partition=[-1:0.2:1];
codebook=[-1.2:0.2:1];
[index,quants,distor]=quantiz(s,partition,codebook);
[partition2,codebook2]=lloyds(s,codebook);
[index2,quants2,distor2]=quantiz(s,partition2,codebook2);
plot(t,s,t,quants,'.',t,quants2,'*');
[distor,distor2]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -