Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 34572

Submitted on 9 Feb 2012

Incorrect

46Size
Leading solution size is 53.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
assert(all(abs(circ_puzz(1,2,3,4)-[-1 18.25])<100*eps))

                    
2
Pass
 
%%
assert(all(abs(circ_puzz(-1/pi,1/2,-3,exp(1))-[0.785398163397448 -5.94105822840435])<100*eps))

                    
3
Fail
 
%%
assert(all(abs(circ_puzz(1/pi,-pi,pi,.01)-[4.93480220054468 -4.59997651648516])<100*eps))
Error: Assertion failed.
4
Pass
 
%%
assert(all(abs(circ_puzz(-2,-3,-5,7)-[ -0.75 -102])<100*eps))

                    
5
Pass
 
%%
assert(all(abs(circ_puzz(3,4,2,1.5)-[-2/3 7.5])<100*eps))