For loop involving concatenation
Ältere Kommentare anzeigen
Hi,
I have a set of data in Excel and want to get the data out and plot. I have been trying to create a for loop unsuccessfully. I want to loop from the letter D-H and then let it loop through. Currently I repeat the commands one by one as below:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%A: Decay of Centreline Peak Velocity
xl = xlsread('lateraldispersion.csv','C3:C9');
Dexp = xlsread('lateraldispersion.csv','D3:D9');
Eexp = xlsread('lateraldispersion.csv','E3:E9');
Fexp = xlsread('lateraldispersion.csv','F3:F9');
Gexp = xlsread('lateraldispersion.csv','G3:G9');
Hexp = xlsread('lateraldispersion.csv','H3:H9');
hold on
plot (xl, Dexp,'ok','linewidth',2.5);
plot (xl, Eexp,'--b','linewidth',2.5);
plot (xl, Fexp,'--r','linewidth',2.5);
plot (xl, Gexp,'--g','linewidth',2.5);
plot (xl, Hexp,'--k','linewidth',2.5);
%%%%%%%%%%%%%%%%%%%%%
Any advice on a more elegant method? Thanks!
Akzeptierte Antwort
Weitere Antworten (1)
kyze
am 19 Jul. 2012
0 Stimmen
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!