Page 1 of 1

1. What do you think this function is for? 2. Explain the inputs and outputs. 3. What would you write in the error state

Posted: Tue Apr 26, 2022 6:02 pm
by answerhappygod
1 What Do You Think This Function Is For 2 Explain The Inputs And Outputs 3 What Would You Write In The Error State 1
1 What Do You Think This Function Is For 2 Explain The Inputs And Outputs 3 What Would You Write In The Error State 1 (362.65 KiB) Viewed 35 times
1. What do you think this function is for? 2. Explain the inputs and outputs. 3. What would you write in the error statement in line 13? 4. What is a way that a user can abuse this function and get an invalid result without triggering the error? Inspect the Matlab function below and answer the above questions IN YOUR OWN WORDS. function [x, i] myMatlabFunc(f, x0 ,x1) = i=0; while abs (x0-x1) >10^(-10) f(x1)*(x1-x0)/(f(x1)-f(x0)) xnext = x1 x0=x1; x1=xnext; i=i+1; if i==100 error ("???????") end end x = x1; end