I know, not very elegant (lol). But it's funny how "strtrim(ans(z*''));" is represented.. at first glance you think ¿How could it work?
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
z = 1;
y_correct = 'H';
assert(isequal(atomicNumber(z),y_correct))
|
2 | Pass |
%%
z = 3;
y_correct = 'Li';
assert(isequal(atomicNumber(z),y_correct))
|
3 | Pass |
%%
z = 5;
y_correct = 'B';
assert(isequal(atomicNumber(z),y_correct))
|
4 | Pass |
%%
z = 7;
y_correct = 'N';
assert(isequal(atomicNumber(z),y_correct))
|
5 | Pass |
%%
z = 22;
y_correct = 'Ti';
assert(isequal(atomicNumber(z),y_correct))
|
6 | Pass |
%%
z = 15;
y_correct = 'P';
assert(isequal(atomicNumber(z),y_correct))
|
7 | Pass |
%%
z = 13;
y_correct = 'Al';
assert(isequal(atomicNumber(z),y_correct))
|
8 | Pass |
%%
z = 10;
y_correct = 'Ne';
assert(isequal(atomicNumber(z),y_correct))
|
Replace NaNs with the number that appears to its left in the row.
2018 Solvers
1800 Solvers
173 Solvers
583 Solvers
315 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!