I am trying to import multiple .txt files and multiple .wav files so that I can later loop through them and create PDFs yet for some reason I cannot get it the data to import and none of the tutorials I have found so far are helpful to me becuase I am a beginner.
Does anyone know how to help?
Folder = "C:\Users\Karianne Kapfer\MATLAB\Final_Assignment\KillerWhales";
%%Where my data is
WavFileList = dir(fullfile(Folder, '*wav'));
TxtFileList = dir(fullfile(Folder, '*txt'));
%%Calling for it to pull these two types of files
%%Need it to import many files
T = importdata('.txt');
A = importdata('.wav')

답변 (1개)

Star Strider
Star Strider 2021년 5월 6일

0 개 추천

It is not importing because the correct approach to reading .wav files is to use audioread.
Try that. It should do what you want.
I have no idea what the problem could be with the .txt files. It would likely be best to use readtable or readmatrix for them.

댓글 수: 2

Karianne Kapfer
Karianne Kapfer 2021년 5월 6일
Neither of those solutions worked, I am still getting errors, but thank you for trying :)
Star Strider
Star Strider 2021년 5월 6일
The question seems to omit several details, not the least of which is a reasonably detailed description of the problem, including all the red text of any errors the code throws, copied from the Command Window and pasted here.
If the problem is processing files, see Process a Sequence of Files .
Posting (attaching) one random example of each type of file could help determine at least part of what the problem is in importing (reading) them. If a specific .txt file matches a specific .wav file in some respect (i.e. both refer to the same whale), attach the matching files.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

질문:

2021년 5월 6일

댓글:

2021년 5월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by