thank you. I have another little problem.
I want to print this array, but it gives a constant error.
n=3;
a=1;
for i=1:n
str =int2str(i);
file =strcat(str,'.wav')
%file = sprintf('%ss%d.wav', traindir, i);
%disp(file);
[s, fs] = wavread(file);
v = mfcc(s, fs); % Compute MFCC's
duz=v(:)';
for i=1:14554
h(a,i)=duz(1,i);
xlswrite('z',h);
end
a=a+1;
end

 采纳的回答

Jan
Jan 2019-6-5
移动:Voss 2023-12-21
I've formatted your code today. Please do this by your own using the menu over the sectin for editing the message.
I've mentioned in another thread of you, that your code contains two loops with the same loop counter i. Please consider the given answers, otherwise it is a waste of time to help you.
Whenever you mention an error in the forum, post a copy of the complete error message also. This is more efficient than letting the readers guess, what the error is.
You overwrite the data in the Excel file in all itereations. The matrix h is growing iteratively. There are no comments which explain, what you want to achieve actually. I guess, the following solves the problem:
n = 3;
h = zeros(n, 14554);
for a = 1:n % i ==> a
file = sprintf('%d.wav', a);
[s, fs] = wavread(file);
v = mfcc(s, fs);
h(a, :) = v(1:14554);
end
xlswrite('z.xls', h);
Keep your code as simple as possible.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Data Import from MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by