%
% plot11B.m
%
% Read (x,y) values and error bars from a data file and plot
%
% Matlab-Monkey.com
% 2/2/2019

% tidy-up your workspace
clc         % clear command window
clear       % clear all variables
close all   % close all graphics windows

data = load('run1.txt');  % read in the data file
x = data(:,1);            % extract x values from 1st column
y = data(:,2);            % extract y values from 2nd column
err = data(:,3);          % extract error bars from 3rd column

% plot data points with error bars
errorbar(x,y,err,'bo','MarkerFaceColor','b');
 
% Label axes and give title
xlabel('x')
ylabel('y')

% Set axis limits for plot
xlim([-0.5 8])              % x axis goes from 0 to 4 pi
ylim([-2 10]);               % y axis goes from -4 to 4
