Iterative Method

x = pi/2; %we suppose the initial value pi/2
for k = 1:15 %for loop is used and start from one and iterates for 15 times
x(k+1)= (1/2)*(cos(x)+3); %value of x is initialized with the given function
disp(x) %to display the iterations

Print Friendly

Share this with your friends

2 Comments to “Iterative Method”

  1. The exisptree shines through. Thanks for taking the time to answer.

  2. very nice

Leave a Reply

Your email address will not be published. Required fields are marked *