%  This m-file is a script that plots data from a file called infile.dat
%  that is in column format.  It assumes the first column is the x-axis
%  and that all other columns define the dependent variables y1...yN.

data = load('infile.dat');

% Assuming infile.dat is in column format, the matrix 'data' is M x N. 
% We can find out how many columns were read in by doing a 'size' command:
[M N] = size(data);


%  The first column vector is assigned to the variable x.  The rest
%  of the columns form a matrix that we assign to y.
x = data(:,1);
y = data(:,2:N);

%  Plot all the data:
plot(x,y);

%%  Questions:  What are the pitfalls of this program?  When does it work
%%  and when might it fail?  How flexible is it?


