What is the code to plot several .dat files together?

Illustration
hardikisharma2 - 2020-08-04T10:25:31+00:00
Question: What is the code to plot several .dat files together?

I have 1000 .dat files and I want to plot graphs from them and save the results in .png format for all the files. How do we do that?

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

figure
hold on
datfiles = dir('*.dat');
for K = 1 : length(datfiles)
  data = load(datfiles(k).name); %load just this file
  % Plot the data depending on variables 
end


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!