Matlab – Plot graphs in MATLAB

file-ioMATLABplot

I have a txt file with the following values on each line:

SRNO  Value1  Value2

There are around 2000 such lines.

I would like to plot both Value1 and Value2 in MATLAB

Any code on how I could do it? Thanks

Best Answer

A simple load then plot would do it:

data = load('file.txt');                            %# load file
plot(data(:,2), data(:,3), '.')                     %# plot value1 vs value2
xlabel('Value 1'), ylabel('Value 2'), title('Plot') %# add axes labels and title