example01.m

来自「使用matlab语言设计的」· M 代码 · 共 14 行

M
14
字号
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 + =
减小字号Ctrl + -
显示快捷键?