function Y = Fsystem(x) % this function is used in solving an example of % a system of non-linear equations n = length(x); Y = zeros(n,1); i = 2:n-1; Y(i) = (3-2*x(i)).*x(i)-x(i-1)-2*x(i+1) + 1; Y(n) = (3-2*x(n)).*x(n)-x(n-1) + 1; y(1) = (3-2*x(1)).*x(1)-2*x(2) + 1; end