Reading datasets by FOR loop!

조회 수: 8 (최근 30일)
M G
M G 2011년 9월 22일
Hey Matlab users,
I would like to have import a series of data sets and then using FOR loop or any other ways take each of data sets for the rest of program. For example:
dataset_1
dataset_2
dataset_3
dataset_4
for i = 1:4
(Qestion: how can I use each of above datasets separately???);
end
Thanks in advance, Mehdi
  댓글 수: 1
Jan
Jan 2011년 9월 22일
More details are needed. It is not clear what "dataset_1" means.

댓글을 달려면 로그인하십시오.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 9월 22일
I think this question has been asked many times. Don't name your variable as dataset_1, dataset_2, ... Now you saw the difficulty of using them in a for-loop. See 'How can I create variables A1, A2,...,A10 in a loop?" in this link. http://matlab.wikia.com/wiki/FAQ
The short answer is to use array dataset(4) so that you can call it in the for-loop as dataset(i).

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by