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

13 Ansichten (letzte 30 Tage)
Ismail Qeshta
Ismail Qeshta am 10 Nov. 2017
Kommentiert: Ismail Qeshta am 13 Nov. 2017
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 Kommentare
Ismail Qeshta
Ismail Qeshta am 13 Nov. 2017
Thank you very much Stephen

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Dishant Arora
Dishant Arora am 10 Nov. 2017

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Export finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by