This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
u= 100;
theta=85;
y_correct = 177;
assert(isequal(round(CannonBall(u,theta)),y_correct))
s =
0
s =
177.0114
|
2 | Pass |
u= 31.42;
theta=45;
y_correct = 101;
assert(isequal(round(CannonBall(u,theta)),y_correct))
s =
0
s =
100.6337
|
3 | Pass |
u= 31.42;
theta=-41;
y_correct = 0;
assert(isequal(round(CannonBall(u,theta)),y_correct))
s =
0
|
4 | Pass |
u= 100;
theta=30;
y_correct = 883;
assert(isequal(round(CannonBall(u,theta)),y_correct))
s =
0
s =
882.7986
|
5 | Pass |
u= -100;
theta=30;
y_correct = 0;
assert(isequal(round(CannonBall(u,theta)),y_correct))
s =
0
|
6 | Pass |
u= -100;
theta=210;
y_correct = 883;
assert(isequal(round(CannonBall(u,theta)),y_correct))
s =
0
s =
882.7986
|
7 | Pass |
u= 100;
theta=210;
y_correct = 0;
assert(isequal(round(CannonBall(u,theta)),y_correct))
s =
0
|
8 | Pass |
u= 0;
theta=40;
y_correct = 0;
assert(isequal(round(CannonBall(u,theta)),y_correct))
s =
0
|
9 | Pass |
u= 100;
theta=90;
y_correct = 0;
assert(isequal(round(CannonBall(u,theta)),y_correct))
s =
0
|
10 | Pass |
u= 100;
theta=0;
y_correct = 0;
assert(isequal(round(CannonBall(u,theta)),y_correct))
s =
0
|
11 | Pass |
filetext = fileread('CannonBall.m');
assert(isempty(strfind(filetext, 'regexp'))); assert(isempty(strfind(filetext, 'eval')))
|
6723 Solvers
Back to basics 6 - Column Vector
908 Solvers
579 Solvers
Determine Whether an array is empty
646 Solvers
Convert a Cell Array into an Array
430 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!