readmatrix in a loop

16 Ansichten (letzte 30 Tage)
Rica
Rica am 1 Jun. 2021
Beantwortet: David Hill am 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'])
end
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!

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by