import multiple files with for loop
4 次查看(过去 30 天)
显示 更早的评论
Hello, i need to know how can i do this with a double for loop,
sza10str2 = importdata("10.0_02_streams.out");
sza10str4 = importdata("10.0_04_streams.out");
sza10str8 = importdata("10.0_08_streams.out");
sza10str16 = importdata("10.0_16_streams.out");
sza30str2 = importdata("30.0_02_streams.out");
sza30str4 = importdata("30.0_04_streams.out");
sza30str8 = importdata("30.0_08_streams.out");
sza30str16 = importdata("30.0_16_streams.out");
i tried something like this but it doesn't woks.
Any suggestions?
Thank you..
x = [10.0 30.0];
y = [02 04 08 16];
for i = 1:2
for j=1:4
sza{i}streams{j} = importdata(sprintf('%d_%d_streams.out', x(i),y(j)));
end
end
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!