How to import data for multiple files in "for" loop?

조회 수: 14 (최근 30일)
Ismail Qeshta
Ismail Qeshta 2017년 11월 10일
댓글: Ismail Qeshta 2017년 11월 13일
Hi, I would like to import data from multiple files using "for" loop. The files follow the seuquene of Data11, Data12, Data13, etc. I tried using the following command, but it is showing an error:
c = [1 2 3 4 5 6 7 8 9 10];
s = [1 2 3 4 5 6 7 8 9 10];
for i=1:10;
for j=1:10;
b=importdata('Data(c(i)s(j)).out');
a=importdata('Data(c(i)s(j)).out');
x= a(:,2);
y= -sum(b(:,2:11),2);
end
end
Can anyone please help me in fixing it, or let me know about the correct code.
Thank you. Regards, Ismail
  댓글 수: 4
Ismail Qeshta
Ismail Qeshta 2017년 11월 13일
Thank you very much Stephen

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

채택된 답변

Dishant Arora
Dishant Arora 2017년 11월 10일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by