In Matlab Consider the multivariable function given by allow
In Matlab:
Consider the multi-variable function given by:
allow the user to input scalar values for x, y, and z and include logic that will stop the script and display an error message if the function is singular or would result in an imaginary number for a provided set of x,y,z. If the function is allowed to evaluate, display the entered values of x,y, and z as well as the value of the function using a single instruction. ?Otherwise, display an error message. Evaluate at the following points (x,y,z):
i. (4,13,15)
ii. (8,-12,0.1)
iii. (0,0,0)
iv. (5,10,15)
Solution
x = input(\'Enter x: \');
y = input(\'Enter y: \');
z = input(\'Enter z: \');
if x + y + z == 0
disp(\'Undefined value of function\');
elseif 5 * z * z + x * y * y * y < 0
disp(\'Imaginary value of function\');
else
disp(((36 * x * y) + sqrt(5 * z * z + x * y * y * y)) / (x + y + z));
end
