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 106990

Submitted on 5 Jul 2012 by Richard Zapor

Correct

24Size
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
 
%%
sumofx = 3; % Lithium
electrons = '1s2,2s1';
assert(isequal(electrons,Aufbau(sumofx)))
ans =
1s2,2s1
2
Pass
 
%%
sumofx = 6; % Carbon
electrons = '1s2,2s2,2p2';
assert(isequal(electrons,Aufbau(sumofx)))
ans =
1s2,2s2,2p2
3
Pass
 
%%
sumofx = 10; % Neon
electrons = '1s2,2s2,2p6';
assert(isequal(electrons,Aufbau(sumofx)))
ans =
1s2,2s2,2p6
4
Pass
 
%%
sumofx = 17; % Chlorine
electrons = '1s2,2s2,2p6,3s2,3p5';
assert(isequal(electrons,Aufbau(sumofx)))
ans =
1s2,2s2,2p6,3s2,3p5