readmatrix in a loop

16 次查看(过去 30 天)
Rica
Rica 2021-6-1
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!

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by