【发布时间】:2014-05-09 16:18:06
【问题描述】:
我正在尝试在 MATLAB 中读取 WAV 文件并将其截断为 1 秒。
这是我现在正在尝试的代码,取自:
http://www.mathworks.com/matlabcentral/answers/596-truncating-wav-files
[x,fs,k] = wavread(FileNames);
Y = x(n:n+fs-1, :);
然而,这给了我以下错误:
Subscript indices must either be real positive integers or logicals.
Error in Test (line 13)
Y = x(n:n+fs-1, :);
我该如何解决这个问题以及如何进行截断?
【问题讨论】:
-
您检查过
n和fs是什么吗?n:n+fs-1的输出是什么?或许你可以自己找到答案。