readmatrix in a loop

31 views (last 30 days)
Rica on 1 Jun 2021
Answered: David Hill on 1 Jun 2021
i tried to use readmatrix in a loop to get data from specified files
for l=1:5
A=readmatrix(['File_' num2str(l) '.txt'])
it seems that A contains not all the data of the files but only of the last files!
I'll be thankfull for your advices!

Accepted Answer

David Hill
David Hill on 1 Jun 2021
for l=1:5
A{l}=readmatrix(['File_' num2str(l) '.txt']);%not sure if all your data is the same size

More Answers (0)


Find more on Loops and Conditional Statements 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!