Question: Im using Octave (like Matlab) and I cant figure out why im getting zero's from my for loop after the 15th interation. Editor File Edit

 Im using Octave (like Matlab) and I cant figure out why

Im using Octave (like Matlab) and I cant figure out why im getting zero's from my for loop after the 15th interation.

Editor File Edit View Debug Run Help ex Command Window exact = -7.2036 foward = oo o o c -10.1496 -7.5007 -7.2333 -7.2066 -7.2039 -7.2036 -7.2036 -7.2036 -7.2036 -7.2036 -7.2035 -7.2049 -7.1765 -7.4607 -7.1054 Project1.mx clc x = 2.75; 3 Create the functions 4 function [y] = f(x) 5 y = 12.5 + 3.5*x*cos (2.45*x); 6 Lend 7 function [v] = df (x) 8 y = 3.5*cos (2.45*x) -8.575*x*sin (2.45**); 9 Lend 10 List of varibles that will be used ll backward = zeros (20, 1); 12 foward - zeros (20, 1); 13 central = zeros (20, 1); 14 backward_error = zeros (20, 1); 15 foward_error = zeros (20, 1); 16 central_error = zeros (20, 1); 17 del = zeros (20, 1); 18 Sexact result of the derivative of f @x 19 exact = df (x) 20 y = f(x); 21 for i = 1:20; 22 del(i, 1) = 10^(-i); 23 backward (1, 1) = (y-f(x-del(i,1)))/delli, 1); 24 foward (i, 1) = (f(x+del(i,1))-y) /del(i,1); 25 central(i, 1) = (f(x+del(i,1))-f(x-del(i,1)))./(2. *del(i,1)); 26 backward_error(i, 1)= exact-backward (i, 1); 27 foward_error(i, 1) = exact-foward(i, 1); 28 central_error(i, 1) = exact-central(i, 1); 29 Lend 30 foward 31 central 32 0 on central - 0 0 4 Na Nam 0 0 0 -7.1943 -7.2035 -7.2036 -7.2036 -7.2036 -7.2036 -7.2036 -7.2036 -7.2036 -7.2036 -7.2035 -7.2049 -7.1765 -7.2831 -7.1054 NO CO OOOOO 0 >>|

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!