For loops in strings
이전 댓글 표시
Hello everyone. I am trying to make a for loop for my project. I am getting audiofiles named 1.wav to 50.wav . I am trying to calculate their energys. But i am changing audio names by my hand. Can I make a loop about it ? I tried that but not working :
for i=1:50
[data,fs]=audioread(['Sound(i).wav']);
end
energy(u)=0
a=length(data);
for l=1:a
energy(l)=(data(l)^2)+energy(l);
end
채택된 답변
추가 답변 (1개)
Jan
2022년 3월 7일
energy = zeros(1, 50);
for k = 1:50
[data, fs] = audioread(sprintf('Sound(%d).wav', k));
energy(k) = sum(data.^2); % ??? + energy(l);
end
카테고리
도움말 센터 및 File Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!