function plot_file(filename) % plot_file(filename) % Plots all of the data in the file % The file should be of the form: % % x1 y1 z1 ... % x2 y2 z2 ... % ... % read in the data into a matrix data = dlmread(filename); [rows, cols] = size(data); % tell matlab to add plots to a single graph % rather than replotting each one individually hold all % plot the data for col = 2:cols plot(data(:,1), data(:, col)) end xlabel('the x axis') ylabel('the y axis') title('Plotting some data')