Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!
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 = 122131221;
y_correct = true;
assert( isequal(isNumPalindrome(x),y_correct) && isempty(regexp(evalc('type isNumPalindrome'),'(str|printf|eval|flip|dec2base)')) )
gg =
     []
sd =
     1
temp =
    12213122
gg =
     1
sd =
     2
temp =
     1221312
gg =
     1     2
sd =
     2
temp =
      122131
gg =
     1     2     2
sd =
     1
temp =
       12213
gg =
     1     2     2     1
sd =
     3
temp =
        1221
gg =
     1     2     2     1     3
sd =
     1
temp =
   122
gg =
     1     2     2     1     3     1
sd =
     2
temp =
    12
gg =
     1     2     2     1     3     1     2
sd =
     2
temp =
     1
gg =
     1     2     2     1     3     1     2     2
sd =
     1
temp =
     0
gg =
     1     2     2     1     3     1     2     2     1
y =
     1

	    	
2
Pass
 
%%
x = 1221;
y_correct = true;
assert( isequal(isNumPalindrome(x),y_correct) && isempty(regexp(evalc('type isNumPalindrome'),'(str|printf|eval|flip|dec2base)')) )
gg =
     []
sd =
     1
temp =
   122
gg =
     1
sd =
     2
temp =
    12
gg =
     1     2
sd =
     2
temp =
     1
gg =
     1     2     2
sd =
     1
temp =
     0
gg =
     1     2     2     1
y =
     1

	    	
3
Pass
 
%%
x = 12345;
y_correct = false;
assert( isequal(isNumPalindrome(x),y_correct) && isempty(regexp(evalc('type isNumPalindrome'),'(str|printf|eval|flip|dec2base)')) )
gg =
     []
sd =
     5
temp =
        1235
gg =
     5
sd =
     5
temp =
   124
gg =
     5     5
sd =
     4
temp =
    12
gg =
     5     5     4
sd =
     2
temp =
     1
gg =
     5     5     4     2
sd =
     1
temp =
     0
gg =
     5     5     4     2     1
y =
     0

	    	
4
Pass
 
%%
x = 9849;
y_correct = false;
assert( isequal(isNumPalindrome(x),y_correct) && isempty(regexp(evalc('type isNumPalindrome'),'(str|printf|eval|flip|dec2base)')) )
gg =
     []
sd =
     9
temp =
   985
gg =
     9
sd =
     5
temp =
    99
gg =
     9     5
sd =
     9
temp =
    10
gg =
     9     5     9
sd =
     0
temp =
     1
gg =
     9     5     9     0
sd =
     1
temp =
     0
gg =
     9     5     9     0     1
y =
     0