필터 지우기
필터 지우기

How can I derive partitions of data sets in for loop

조회 수: 1 (최근 30일)
Ioannis
Ioannis 2013년 10월 9일
답변: A Jenkins 2013년 10월 9일
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