Question: Rewrite the MATLAB user-defined function mybab(x), which was developed earlier in class and returns the squareroot of a number using the Babylonian method, in such

Rewrite the MATLAB user-defined function mybab(x), which was developed earlier in class and returns the squareroot of a number using the Babylonian method, in such a way that it will now include a check for the error in user input, or so called "error-trap". This function will return two values, the squareroot and an integer error code. Identify all possible cases of user input error. You can use the following MATLAB built-in functions is char (x) which will return 1 if x is a character string, and zero otherwise sire X (n) which will return 1 if n is a real number, and zero otherwise y = is char ('My Name'); % This will make y = 1 a = 3.5; z = is real(a); % This will make z = 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
