print on the bottom line

3 ビュー (過去 30 日間)
tekin yorgun
tekin yorgun 2019 年 6 月 4 日
コメント済み: Jan 2019 年 6 月 5 日
hata.png
  1 件のコメント
Jan
Jan 2019 年 6 月 4 日
It would be much easier to write the solution, if you post the code as text and not as screen shot. Allowing the readers to use the code by copy&paste is a polite strategy.

サインインしてコメントする。

採用された回答

Jan
Jan 2019 年 6 月 4 日
編集済み: Jan 2019 年 6 月 4 日
You have 2 for i loops. Omit the inner one, because it overwrite all formerly existing values and repeats them 5 times.
h = zeros(n, 5);
for i = 1:n
file = sprintf('%d.wav', i);
[s, fs] = wavread(file);
h(i, :) = mfcc(s, fs);
end
  2 件のコメント
tekin yorgun
tekin yorgun 2019 年 6 月 5 日
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 日
I showed you already how to simplify your code and mentioned, that two nested loops with the same loop counter i are confusing. Please consider such suggestions.
You have posted the new question in a new thread, which is the correct way. If the problem of this thread is solved, please mark the answer as "accpeted".

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by