Cody

# Problem 542. Vectorizing, too easy or too hard?

Solution 1737935

Submitted on 27 Feb 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
assert(isequal(vect('x*x'),'x.*x'))

y = 'x*x'

Unable to perform assignment because the left and right sides have a different number of elements. Error in vect (line 5) y(i)='.y(i)' Error in Test1 (line 1) assert(isequal(vect('x*x'),'x.*x'))

2   Fail
assert(isequal(vect('x^y'),'x.^y'))

y = 'x^y'

Unable to perform assignment because the left and right sides have a different number of elements. Error in vect (line 5) y(i)='.y(i)' Error in Test2 (line 1) assert(isequal(vect('x^y'),'x.^y'))

3   Fail
assert(isequal(vect('x/z'),'x./z'))

y = 'x/z'

Unable to perform assignment because the left and right sides have a different number of elements. Error in vect (line 5) y(i)='.y(i)' Error in Test3 (line 1) assert(isequal(vect('x/z'),'x./z'))

4   Fail
assert(isequal(vect('(x*y)/z^w'),'(x.*y)./z.^w'))

y = '(x*y)/z^w'

Unable to perform assignment because the left and right sides have a different number of elements. Error in vect (line 5) y(i)='.y(i)' Error in Test4 (line 1) assert(isequal(vect('(x*y)/z^w'),'(x.*y)./z.^w'))