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 173416

Submitted on 5 Dec 2012

Incorrect

15Size
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
 
%%
assert(isequal(phoneword2number('1-800-COLLECT'),[1 8 0 0 2 6 5 5 3 2 8]))
Error: Subscript indices must either be real positive integers or logicals.
2
Fail
 
%%
assert(isequal(phoneword2number('1-800-CONTACTS'),[1 8 0 0 2 6 6 8 2 2 8 7]))
Error: Subscript indices must either be real positive integers or logicals.
3
Pass
 
%%
assert(isequal(phoneword2number('1800FLOWERS'),[1 8 0 0 3 5 6 9 3 7 7]))

                    
4
Fail
 
%%
assert(isequal(phoneword2number('800-BUSINESS'),[8 0 0 2 8 7 4 6 3 7 7]))
Error: Subscript indices must either be real positive integers or logicals.