%example of a for loop for an iterative equation
clear all
x_old=0; %initialize the x_old value, use initial condition
x_new=1000; %initialize the x_new value, can put any value here
x_out(1)=0; NULLalue of x_out for i=0
i_out(1)=0; 0irst value of i_out
f
%Parametric solution to a matrix equation
clear all
A=zeros(3);
b=zeros(3,1);
A=[3,4,-5;1,-3,2;0,1,-1]; %initialize the A matrix
b=[2;5;1]; %write the b vector
x=0;y=0;z=0;a=0; %initialize the output variables
for i= 1:51
a(i)=5+(i-1)/10;
A(3,1)=a(i);
%example of a while loop for an iterative equation
clear all
x_old=0; %initialize the x_old value, use initial condition
x_new=0; %initialize the x_new value, <1.6 (less than the stop value; if not done, the while loop will not execute)
i=0; %current valu