NM Assignment Zain
NM Assignment Zain
MATLAB
PREPARED FOR
Mr. Shoaib Ahmed
PREPARED BY
M. Zain ul Abideen
CMS: 408541
QUESTION 1;
CODE:
% Define the function
f = @(x, y, z) x^2 + y^2 + z^2 - 25;
% Initial guesses for the roots (ensure that f(xl) and f(xu) have opposite signs)
xl = 0; % Lower bound guess for x
xu = 5; % Upper bound guess for x
OUTPUT:
QUESTION 2;
CODE:
% Define the coefficients matrix A and the constants vector b
A = [4, -1, 1;
2, 5, 2;
1, 2, 4];
b = [8; 3; 11];
% Augmented matrix [A | b]
augmented_matrix = [A, b];
OUTPUT:
THE END