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 366606

Submitted on 8 Dec 2013

Incorrect

45Size
Leading solution size is 11.
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
Fail
 
%%
eqn='CH4';
mass=atomic_wt(eqn)
assert(isequal(mass,16))
Error: Output argument "mass" (and maybe others) not assigned during call to "/users/msssystem4/atomic_wt.m>atomic_wt".
2
Fail
 
%%
eqn='O2';
mass=atomic_wt(eqn)
assert(isequal(mass,32))
Error: Output argument "mass" (and maybe others) not assigned during call to "/users/msssystem4/atomic_wt.m>atomic_wt".
3
Fail
 
%%
eqn='CO2';
mass=atomic_wt(eqn)
assert(isequal(mass,44))
Error: Output argument "mass" (and maybe others) not assigned during call to "/users/msssystem4/atomic_wt.m>atomic_wt".
4
Fail
 
%%
eqn='C2H6';
mass=atomic_wt(eqn)
assert(isequal(mass,30))
Error: Output argument "mass" (and maybe others) not assigned during call to "/users/msssystem4/atomic_wt.m>atomic_wt".
5
Fail
 
%%
eqn='H2SO4'; % 98
mass=atomic_wt(eqn)
assert(isequal(mass,98))
Error: Output argument "mass" (and maybe others) not assigned during call to "/users/msssystem4/atomic_wt.m>atomic_wt".
6
Fail
 
%%
eqn='SO4'; % 96
mass=atomic_wt(eqn)
assert(isequal(mass,96))
Error: Output argument "mass" (and maybe others) not assigned during call to "/users/msssystem4/atomic_wt.m>atomic_wt".
7
Fail
 
%%
eqn='NO2'; % 46
mass=atomic_wt(eqn)
assert(isequal(mass,46))
Error: Output argument "mass" (and maybe others) not assigned during call to "/users/msssystem4/atomic_wt.m>atomic_wt".
8
Fail
 
%%
eqn='NO'; % 30
mass=atomic_wt(eqn)
assert(isequal(mass,30))
Error: Output argument "mass" (and maybe others) not assigned during call to "/users/msssystem4/atomic_wt.m>atomic_wt".