homework_5nmbr5 - for i = 1:100 x_new = 1(11(x_old...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Adam Edison Section 7 Homework problem 5 for an iterative equation. clear all x_old = 0.01; %initialize the x_old value, used the initial condition x_new = 1000; %initialized the x_new value x_out(1) = 0.01; %calculated of x_out for i=0 i_out(1) = 0; %first value of i_out
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for i = 1:100 x_new = 1 + (11 / (x_old +3));%computed the new value for x i_out(i+1) = i; %stored the value of i x_out(i+1) = x_new; %store the value of x x_old = x_new;%puts the new x as the old for the next iteration end plot(i_out,x_out)...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online