How to load many .txt files in loop?

1 view (last 30 days)
Rohini Alla
Rohini Alla on 23 Apr 2015
Answered: dpb on 23 Apr 2015
i am very new to matlab, please help me.
A). For my project i need to load 91 .txt files into loop to perform wavelet decomposition at level 4. Each .txt file consists of 1 column of data and 4097 rows. I have used the following code but don't know how to modify it.
load ??; (I dont know how to load 91 .txt files in loop)
s = ??(1:4097);
l_s = length(s);
[cA4,cD4] = dwt(s,'db1');
A4 = upcoef('a',cA4,'db1',4,l_s); (Should i also change the db1 to db4?)
D4 = upcoef('d',cD4,'db1',4,l_s); (Should i also change the db1 to db4?)
plot(A4);
also i need to plot all the Approximations of 91 .txt files in 1 window of the 4th level of decomposition only. please help me :)
rohini.a119@gmail.com if anyone wants to help me further...... thank you soo much :)

Answers (1)

dpb
dpb on 23 Apr 2015
See the FAQ at <How_can_I_process_a_sequence_of_files?> For a set of files with a common extension, the dir solution shown is my recommendation...

Categories

Find more on Denoising and Compression in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!