specify directory and automatic save files in loop
이전 댓글 표시
Hello everybody: I have a matrix have composed of several columns sometimes 24 other times 6 etc. I want to choose a folder and then automatic save colums as wav files such as: 1.wav, 2.wav ....24.wav, but this code failed to work ?? Does anybody know how to do it ??
folder = uigetdir(); % Or wherever you want.
for i = 1 : n
% Create a filename.
baseFileName = sprintf('Cell%d.wav', i);
filename = fullfile(folder, baseFileName);
% Write the wav files.
wavwrite(mat(:,i),Fs,16,filename);
end
댓글 수: 3
Stephen23
2018년 3월 19일
@Mohamed Gamal: what is your question for us? Your code basically seems okay: do you have any specific problem?
Mohamed Gamal
2018년 3월 19일
Akira Agata
2018년 3월 20일
I would recommend replacing wavwrite with audiowrite, like:
audiowrite(filename,mat(:,i),Fs)
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!