Plotting several .txt files
Show older comments
I want to read several .txt files and plot the 4th and 5th columns of each of them in just one grap. I tried adapting the code from Here but the graph appears blank. IF it would be possible, I would also like to put and identification on each 2D line. Here is what I got so far,
myFolder = 'Users\adminstrator\Desktop\Curves';
filePattern = fullfile(myFolder, '*.txt');
theFiles = dir(filePattern);
for k = 1 : length(theFiles)
baseFileName = theFiles(k).name;
fullFileName = fullfile(theFiles(k).folder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
plot(fullFileName(:,4),fullFileName(:,5));
hold on
end
hold off
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!