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 225816

Submitted on 31 Mar 2013

Incorrect

45Size
Leading solution size is 57.
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(isequal(circle_points(1),4))

                    
2
Pass
 
%%
assert(isequal(circle_points(3),4))

                    
3
Pass
 
%%
assert(isequal(circle_points(5),12))

                    
4
Pass
 
%%
assert(isequal(circle_points(65),36))

                    
5
Fail
 
%%
assert(isequal(circle_points(64090),324))
Error: Out of memory. Type HELP MEMORY for your options.
6
Fail
 
%%
assert(isequal(circle_points(2417899275),20))
Error: Out of memory. Type HELP MEMORY for your options.
7
Fail
 
%%
assert(isequal(circle_points(31432690549),8748))
Error: Out of memory. Type HELP MEMORY for your options.
8
Fail
 
%%
assert(isequal(circle_points(1021090952484265),236196))
Error: Maximum variable size allowed by the program is exceeded.
9
Fail
 
%%
assert(isequal(circle_points(6095127531752228),78732))
Error: Maximum variable size allowed by the program is exceeded.
10
Fail
 
%%
assert(isequal(circle_points(5*circle_points(630209)),12))
Error: Out of memory. Type HELP MEMORY for your options.
11
Fail
 
%%
assert(isequal(circle_points(65*circle_points(236009)),36))
Error: Out of memory. Type HELP MEMORY for your options.
12
Pass
 
%%
filetext = fileread('circle_points.m');
assert(isempty(strfind(filetext, 'switch')))
assert(isempty(strfind(filetext, 'case')))