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 320539

Submitted on 18 Sep 2013 by @bmtran

Correct

25Size
Leading solution size is 14.
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
 
%%
A=uint32(5);
B=uint32(6);
C=uint32(4);
s_exp=3;
s=uint_function(A,B,C);
assert(isequal(s,s_exp),sprintf('s = %3i',s))

                    
2
Pass
 
%%
A=uint32(7);
B=uint32(6);
C=uint32(12);
s_exp=13;
s=uint_function(A,B,C);
assert(isequal(s,s_exp),sprintf('s = %3i',s))

                    
3
Pass
 
%%
A=uint16(1);
B=uint16(6);
C=uint16(5);
s_exp=0;
s=uint_function(A,B,C);
assert(isequal(s,s_exp),sprintf('s = %3i',s))

                    
4
Pass
 
%%
A=uint64(12);
B=uint64(14);
C=uint64(3);
s_exp=1;
s=uint_function(A,B,C);
assert(isequal(s,s_exp),sprintf('s = %3i',s))

                    
5
Pass
 
%%
A=uint8(4);
B=uint8(8);
C=uint8(4);
s_exp=0;
s=uint_function(A,B,C);
assert(isequal(s,s_exp),sprintf('s = %3i',s))