MATLAB: What is the code to plot several .dat files together graphplotsimulation 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? Best Answer figurehold ondatfiles = dir('*.dat');for K = 1 : length(datfiles) data = load(datfiles(k).name); %load just this file % Plot the data depending on variables end Related SolutionsMATLAB: Importing 30 .dat files in order for k=1:30data=load(['composite' num2str(k) '.dat]);data_matrix(:,k)=data;end MATLAB: How to create .png files having same file name as the .dat file from which I’m writing the code Use fileparts: [fpth,fnm] = fileparts(original_name); new_name = fullfile(fpth,[fnm,'.png']); Related QuestionHow to make matlab read the files in orderHow to import multiple .dat files from a folder in MatlabPlotting multiple .dat files in MatlabHow to import .csv data into guide
Best Answer