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

采纳的回答

A Jenkins
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 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by