How can I derive partitions of data sets in for loop

1 view (last 30 days)
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

Accepted Answer

A Jenkins
A Jenkins on 9 Oct 2013
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.

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!