If you want all the points for each iteration in the 2 figures, then you will have to insert a hold on after each plotting command:
figure(1);
plot(iter,TrueErr,'.');
hold on
xlabel('Number of Iterations');
ylabel('True Error');
figure(2);
plot(iter, AppErr,'.');
hold on
xlabel('Number of Iterations');
ylabel('Approximate Error');
You might also have to set:
axis auto
This is if you want to see how the iteration proceeds, which is sometimes convenient/soothing/necessary/interesting.
But this is a clumsy way to go about this if you only want to see how the iteration process worked after it finished. For this case it is better to store away everyting you want to look at in arrays and plot everyting after the end of the iteration. Perhaps something like:
AppErr = (xR*ea)/100;
TrueErr = 0.56714329 - xR;
TruErrAll(iter) = Truerr;
AppErrAll(iter) = (xR*ea)/100;
end
figure(1);
plot(TrueErrAll);
xlabel('Number of Iterations');
ylabel('True Error');
figure(2);
plot(AppErrAll);
xlabel('Number of Iterations');
ylabel('Approximate Error');
I bloody well hope I guessed close enough...
HTH