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.
|
1261 Solvers
272 Solvers
Back to basics 21 - Matrix replicating
1052 Solvers
516 Solvers
414 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!