Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
filetext = fileread('myCos.m');
assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')
|
2 | Pass |
filetext = fileread('myCos.m');
trigUsed = any(strfind(filetext, 'cos')) || any(strfind(filetext, 'sin')) ||...
any(strfind(filetext, 'exp'));
assert(~trigUsed, 'Cannot use MATLAB trigonometric functions')
|
3 | Pass |
x = 0;
assert(abs(myCos(x)-cos(x)) < 0.0001)
y =
1
|
4 | Pass |
x = pi;
assert(abs(myCos(x)-cos(x)) < 0.0001)
y =
-1.0000
|
5 | Pass |
x = pi/2;
assert(abs(myCos(x)-cos(x)) < 0.0001)
y =
4.2540e-17
|
6 | Pass |
x = 5*pi/3;
assert(abs(myCos(x)-cos(x)) < 0.0001)
y =
0.5000
|
54255 Solvers
1092 Solvers
Find nearest prime number less than input number
268 Solvers
Try 1.5.4: Celsius to Fahrenheit
609 Solvers
382 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!