Cody

Solution 217412

Submitted on 14 Mar 2013 by Selvaraaju Murugesan
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   Pass
%% v=[10^8 10^7 10^6 10^5 10^4 10^3 100 10 1]; pcoef='103050709'; mcoef='010203040'; sum = 92847669; assert(isequal(linear_vec_sum(v, pcoef, mcoef),sum))
y = 0 1 0 2 0 3 0 4 0
2   Pass
%% v=[5 2 8]; pcoef='840'; mcoef='006'; sum = 0; assert(isequal(linear_vec_sum(v, pcoef, mcoef),sum))
y = 0 0 6
3   Pass
%% v=[12 6 16]; pcoef='110'; mcoef='001'; sum = 2; assert(isequal(linear_vec_sum(v, pcoef, mcoef),sum))
y = 0 0 1