MATLAB: Plotting certain columns from a .dat file

.dat file

Greetings all,
It's been quite some time since I've used MATLAB, and embarrasingly I've been struggling with this all day. Needless to say I am a bit rusty! I have a data file that has 8 columns of data (and has headers at the top). Right now I'm trying to just plot column 2 of the data on the x-axis and plot the 4th and 8th columns as two line plots along the y-axis.
I imagine you use fopen and textscan, but there's so many to choose from. Maybe importdata?
Any help would be appreciated. Thanks!

Best Answer

If your data file format is consistent, try
data=importdata('MyFile.data');
For plotting, if you have a matrix A, A(:,2) is all the data in the second column so you can do:
plot(A(:,2),A(:,4),'r',A(:,2),A(:,8),'b');