Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
a = 1;
n = 1;
f_correct = a*exp(n);
assert(abs(approx_e(a,n)-f_correct)<.001)
ans =
2.718281801146385e+00
|
2 | Pass |
a = 2^18;
n = 0;
f_correct = a*exp(n);
assert(abs(approx_e(a,n)-f_correct)<.001)
ans =
262144
|
3 | Pass |
a = pi;
n = pi;
f_correct = a*exp(n);
assert(abs(approx_e(a,n)-f_correct)<.001)
ans =
7.269862767931467e+01
|
4 | Pass |
a = -exp(1);
n = exp(2);
f_correct = a*exp(n);
assert(abs(approx_e(a,n)-f_correct)<.001)
ans =
-4.398663504056287e+03
|
5 | Pass |
filetext = fileread('approx_e.m');
assert(isempty(strfind(filetext,'exp')))
assert(isempty(strfind(filetext,'str')))
assert(isempty(strfind(filetext,'cat')))
assert(isempty(strfind(filetext,'feval')))
assert(all(cellfun(@(z)str2num(z)==round(str2num(z)),regexp(filetext,'[0123456789.]+','match'))))
assert(isempty(regexp(filetext,'\d+e')))
|
819 Solvers
232 Solvers
Find the largest value in the 3D matrix
1056 Solvers
2810 Solvers
Check that number is whole number
1070 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!