Matlab: Open and plot all files in register
Open and plot of all files in a register ( German ) This plot is about to open and plot all files in a register with Matlab. First of all, all files with the format *.txt are opend and saved in files. files = dir('*.csv'); For value = 2 just every second file is saved. for i = 1:1:length(files)/value fid3{i}=files(i).name; end To sort these files by name you need to download "natsortfiles" from Matlab-Exchang: fid3 = natsortfiles(fid3) for i = 1:value:length(files) fid = fopen(fid3{i}); daten = textscan(fid,'%f %f','delimiter',',','headerlines',0'); q1(:,i/value) = daten(1); q2(:,i/value) = daten(2); end fclose(fid); In "textscan" with 'headlines',0 is the amount of rows are defined which are delited from the text file. The files from coulomn 1 are saved in q1 and from coulomn 2 are saved in q2. Furthermore the files are opened and saved in a matrix and in a defin...