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.
|
543 Solvers
Back to basics 8 - Matrix Diagonals
707 Solvers
533 Solvers
Find the maximum number of decimal places in a set of numbers
156 Solvers
Calculate the area of a triangle between three points
278 Solvers