How can I derive partitions of data sets in for loop
1 次查看(过去 30 天)
显示 更早的评论
Hello I have a bunch of data-sets. Each one has 4 columns.
I load them as follows:
for i=1:20
load(['c',num2str(i)])
end
But then, I want to create a new matrix within a for loop, which will store from each file specific samples from a specific column. What I tried and it failed is the following
for j=1:20
dd(:,j)=(['c',num2str(j),'(410:910,2)'])
end
Any hints on how to get around this?
Kind Regards
0 个评论
采纳的回答
A Jenkins
2013-10-9
Creating arrays with the number in the name is considered bad programming practice, so instead of fixing your code, most people will recommend you use a different method to store your data. If you MUST do it this way, then you will need to use eval.
But please read the FAQ first.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!