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 |
compdist = @(a,b) abs(a-b);
mag = 1;
arg_deg=0;
c_correct = 1;
assert(compdist(cp2r(mag,arg_deg),c_correct)<1e-12)
|
2 | Pass |
compdist = @(a,b) abs(a-b);
mag = 1;
arg_deg=90;
c_correct = i;
assert(compdist(cp2r(mag,arg_deg),c_correct)<1e-12)
|
3 | Pass |
compdist = @(a,b) abs(a-b);
mag = 5;
arg_deg=-30;
c_correct = 4.33012701892219e+00 - 2.50000000000000e+00i;
assert(compdist(cp2r(mag,arg_deg),c_correct)<1e-12)
|
4 | Pass |
compdist = @(a,b) abs(a-b);
mag = -2;
arg_deg=-20;
assert(isnan(cp2r(mag,arg_deg)))
|
5 | Pass |
compdist = @(a,b) abs(a-b);
mag = 0.1;
arg_deg=-8000;
c_correct = 17.36481776669513e-03 - 98.48077530122045e-03i;
assert(compdist(cp2r(mag,arg_deg),c_correct)<1e-12)
|
Project Euler: Problem 10, Sum of Primes
707 Solvers
4331 Solvers
Similar Triangles - find the height of the tree
203 Solvers
204 Solvers
Simple equation: Annual salary
3779 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!