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 220581

Submitted on 22 Mar 2013 by Alfonso Nieto-Castanon

Correct

16Size
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
 
%%
s = 'Cl';
y_correct = 17;
assert(isequal(atomicNumber2(s),y_correct))

                    
2
Pass
 
%%
s = 'Au';
y_correct = 79;
assert(isequal(atomicNumber2(s),y_correct))

                    
3
Pass
 
%%
s = 'Dy';
y_correct = 66;
assert(isequal(atomicNumber2(s),y_correct))

                    
4
Pass
 
%%
s = 'O';
y_correct = 8;
assert(isequal(atomicNumber2(s),y_correct))

                    
5
Pass
 
%%
s = 'Ge';
y_correct = 32;
assert(isequal(atomicNumber2(s),y_correct))

                    
6
Pass
 
%%
s = 'Uut';
y_correct = 113;
assert(isequal(atomicNumber2(s),y_correct))

                    
7
Pass
 
%%
s = 'C';
y_correct = 6;
assert(isequal(atomicNumber2(s),y_correct))

                    
8
Pass
 
%%
s = 'Xe';
y_correct = 54;
assert(isequal(atomicNumber2(s),y_correct))

                    
9
Pass
 
%%
s = 'Hg';
y_correct = 80;
assert(isequal(atomicNumber2(s),y_correct))