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 331756

Submitted on 9 Oct 2013 by Alfonso Nieto-Castanon

Correct

33Size
This is the leading solution.
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 = 4;
tf_correct = true;
assert(isequal(isSmith(x),tf_correct ))

                    
2
Pass
 
%%
x = 265;
tf_correct = true;
assert(isequal(isSmith(x),tf_correct ))

                    
3
Pass
 
%%
x = 588;
tf_correct = true;
assert(isequal(isSmith(x),tf_correct ))

                    
4
Pass
 
%%
x = 1086;
tf_correct = true;
assert(isequal(isSmith(x),tf_correct ))

                    
5
Pass
 
%%
x = 4937775;
tf_correct = true;
assert(isequal(isSmith(x),tf_correct ))

                    
6
Pass
 
%%
x = 5;
tf_correct = false;
assert(isequal(isSmith(x),tf_correct ))

                    
7
Pass
 
%%
x = 1000;
tf_correct = false;
assert(isequal(isSmith(x),tf_correct ))

                    
8
Pass
 
%%
x = 94.1;
tf_correct = false;
assert(isequal(isSmith(x),tf_correct ))

                    
9
Pass
 
%%
x = 202.689;
tf_correct = false;
assert(isequal(isSmith(x),tf_correct ))

                    
10
Pass
 
%%
x = pi;
tf_correct = false;
assert(isequal(isSmith(x),tf_correct ))

                    
11
Pass
 
%%
x = -4;
tf_correct = false;
assert(isequal(isSmith(x),tf_correct ))