Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Read different file names using wavread

Asked by Ikra89

Ikra89 (view profile)

on 10 Feb 2013

Hello all

i have a problem about how to read many files using wavread.

i confused about how to read different name using single line code.

for eg:

i have files:

sound1

sound2

sound3

sound4

sound5

if 1 sound file have dimension 10000x1, so i have 10000x5.

how to read and save into new matrix name with that conditon.

thanks before

regards

Ikra

0 Comments

Ikra89

Ikra89 (view profile)

Products

2 Answers

Answer by Azzi Abdelmalek

Azzi Abdelmalek (view profile)

on 10 Feb 2013
Edited by Azzi Abdelmalek

Azzi Abdelmalek (view profile)

on 10 Feb 2013
Accepted answer
for k=1:6
  filename=sprintf('sound%d.wav',k)
  s{k}=wavread(filename)
end

0 Comments

Azzi Abdelmalek

Azzi Abdelmalek (view profile)

Answer by Ikra89

Ikra89 (view profile)

on 10 Feb 2013

its working

thank you very much :)

0 Comments

Ikra89

Ikra89 (view profile)

Contact us