? No solution between a and b, Xs=[] (Pretest)
Output argument "Xs" (and maybe others) not assigned during call to "BisectionRoot".
Error in Test2 (line 3)
Xs=BisectionRoot(fun, 1,2)
Test Code:
1% Run learner solution.
2 fun=@(x)x-2*exp(-x);
3 Xs=BisectionRoot(fun, 1,2)
4
5% Run reference solution.
6 Xtrue=fzero(fun, 1);
7
8% Compare.
9 assessVariableEqual('Xs', []);
10
11 % Do not use fzero in solution
12 assessFunctionAbsence('fzero', 'FileName', 'BisectionRoot.m')
Output:
Error: no solution over interval