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 275601

Submitted on 8 Jul 2013

Incorrect

47Size
Leading solution size is 11.
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
 
%%
x = 10;
y_correct = false;
assert(isequal(your_fcn_name(x),y_correct))
p =
     []
x =
     5
p =
     5
x =
    2.5000
p =
    5.0000    2.5000
x =
    1.2500
p =
    5.0000    2.5000    1.2500
x =
    0.6250
p =
    5.0000    2.5000    1.2500    0.6250
y =
     0
2
Fail
 
%%
x = 28;
y_correct = true;
assert(isequal(your_fcn_name(x),y_correct))
Error: Assertion failed.
3
Fail
 
%%
x = 8128;
y_correct = true;
assert(isequal(your_fcn_name(x),y_correct))
Error: Assertion failed.
4
Pass
 
%%
x = 564;
y_correct = false;
assert(isequal(your_fcn_name(x),y_correct))
p =
     []
x =
   282
p =
   282
x =
   141
p =
   282   141
x =
   70.5000
p =
  282.0000  141.0000   70.5000
x =
   35.2500
p =
  282.0000  141.0000   70.5000   35.2500
x =
   17.6250
p =
  282.0000  141.0000   70.5000   35.2500   17.6250
x =
    8.8125
p =
  282.0000  141.0000   70.5000   35.2500   17.6250    8.8125
x =
    4.4062
p =
  282.0000  141.0000   70.5000   35.2500   17.6250    8.8125    4.4062
x =
    2.2031
p =
  282.0000  141.0000   70.5000   35.2500   17.6250    8.8125    4.4062    2.2031
x =
    1.1016
p =
  282.0000  141.0000   70.5000   35.2500   17.6250    8.8125    4.4062    2.2031    1.1016
x =
    0.5508
p =
  282.0000  141.0000   70.5000   35.2500   17.6250    8.8125    4.4062    2.2031    1.1016    0.5508
y =
     0