错误使用 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

采纳的回答

果博东方开户网址【微8785092】
你的m不是整数,使用reshape函数需要你自己注意维度参数,你有12个元素可以拆成3和4,那你有13个元素,咋拆成3和4,所以就得将13个元素中去除一个元素,在使用reshape,自己先计算一下吧

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 快速入门 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!