Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
qe_correct1_1 = -1;
qe_correct1_2 = -2;
[qe_result1_1, qe_result1_2] = SolveQuadraticEquation(1, 3, 2);
assert( (abs(qe_result1_1 - qe_correct1_1) < 0.0001 && ...
abs(qe_result1_2 - qe_correct1_2) < 0.0001) || ...
(abs(qe_result1_1 - qe_correct1_2) < 0.0001 && ...
abs(qe_result1_2 - qe_correct1_1) < 0.0001) );
l =
-2
-1
|
2 | Pass |
qe_correct2_1 = 0.224745;
qe_correct2_2 = -2.22474;
[qe_result2_1, qe_result2_2] = SolveQuadraticEquation(2, 4, -1);
assert( (abs(qe_result2_1 - qe_correct2_1) < 0.0001 && ...
abs(qe_result2_2 - qe_correct2_2) < 0.0001) || ...
(abs(qe_result2_1 - qe_correct2_2) < 0.0001 && ...
abs(qe_result2_2 - qe_correct2_1) < 0.0001) );
l =
-2.2247
0.2247
|
3 | Pass |
qe_correct3_1 = -1;
qe_correct3_2 = -1;
[qe_result3_1, qe_result3_2] = SolveQuadraticEquation(2, 4, 2);
assert( (abs(qe_result3_1 - qe_correct3_1) < 0.0001 && ...
abs(qe_result3_2 - qe_correct3_2) < 0.0001) || ...
(abs(qe_result3_1 - qe_correct3_2) < 0.0001 && ...
abs(qe_result3_2 - qe_correct3_1) < 0.0001) );
l =
-1
-1
|
4 | Pass |
[qe_result4_1, qe_result4_2] = SolveQuadraticEquation(4, 4, 4);
assert( isnan(qe_result4_1) && isnan(qe_result4_2) );
l =
-0.5000 + 0.8660i
-0.5000 - 0.8660i
x1 =
NaN
x2 =
NaN
|
5 | Pass |
[qe_result5_1, qe_result5_2] = SolveQuadraticEquation(9.1, 12, 4.1);
assert( isnan(qe_result5_1) && isnan(qe_result5_2) );
l =
-0.6593 + 0.1258i
-0.6593 - 0.1258i
x1 =
NaN
x2 =
NaN
|
Generate N equally spaced intervals between -L and L
563 Solvers
Find out missing number from a vector of 9 elements
245 Solvers
5117 Solvers
376 Solvers
Area of an equilateral triangle
2761 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!