Cody

# Problem 44062. Polar Form Complex Number Entry

Solution 1145233

Submitted on 24 Mar 2017 by Isaac Abraham
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

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)

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!