Hmmm, description is a little confusing. Is length(x) always = length(y)? Are they nx1 or 1xn? Anyhow, I submitted several possible solutions (e.g. z = x'*y, z = sum(x.*y)) all of which failed the test suite ... but they work fine on my machine!
Note that the output variable in the pattern is y, not z.
ha, yeah. thanks for commenting about that. I didn't see it either.
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
%%
x = 1:3;
y= 3:-1:1;
z_correct = 10;
assert(isequal(your_fcn_name(x,y),z_correct))
Error: Assertion failed.
|
2 | Fail |
%%
x = 1:6;
y= ones(1,6);
z_correct = 21;
assert(isequal(your_fcn_name(x,y),z_correct))
Error: Assertion failed.
|
3113 Solvers
951 Solvers
Get the area codes from a list of phone numbers
532 Solvers
Find the maximum number of decimal places in a set of numbers
734 Solvers
485 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!