你的m不是整数,使用reshape函数需要你自己注意维度参数,你有12个元素可以拆成3和4,那你有13个元素,咋拆成3和4,所以就得将13个元素中去除一个元素,在使用reshape,自己先计算一下吧
错误使用 reshape 大小参数必须为整型实数。
16 次查看(过去 30 天)
显示 更早的评论
x=cos(2*pi*30*t)+sin(2*pi*120*t);
encode=PCMcoding(x);
m=length(encode)/8;
encode=(reshape(encode',8,m))';
错误使用 reshape
大小参数必须为整型实数。
出错 PCMdecoding (line 3)
encode=(reshape(encode',8,m))';
这是什么原因啊?有没有大佬来帮帮我:Q
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!