This question already has an answer here:
Plotting graph using for loop in MatLab
Im trying to plot iterations vs error_delta but its not showing.
but its not showing the line of plotting.
We suppose to plot the iterations as the error_delta is in the y-axis, with the error_delta= abs(root_delta-x);
% root for f(x) = cos(x)
paso = 0.5e-10;
N = 100;
x= 1.0; %initial guess.
i = 0;
eps = 1;
root_delta = 4.6;
while eps >= paso && i <= N %while loop to iterate
y = x - (cos(x)/(-sin(x)));
eps = abs(y-x);
error_delta = abs(root_delta - x);
i = i+1;
disp(' root iteration');