filename = 'Cyprus.2010.101.07.52.G06.txt'; delimiterIn = ' ';% headerlinesIn = 1;
A = importdata(filename,delimiterIn);Altitude = A(:,1);Digisonde = A(:,2);COSMIC = A(:,3);plot(Altitude, Digisonde,'--blo', Altitude, COSMIC, ':r*')title('Day Number:101 Year:2010 07:52 UT Station: Cyprus')xlabel('Altitude (Km)')ylabel('Electron Density (/m3)')legend('Digisonde', 'COSMIC')saveas(gcf,'101_2010.jpg')
This code gives plot for a single .txt file. But if I want to process all the .txt files in the same directory in a loop, how to proceed? The file names are not sequentially numbered. Please help.
Best Answer