This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
y1=[0 1 2 3 4]'
y2=[2 3 4 5 6]'
y_correct = sum((y1-mean(y1)).*(y2-mean(y2)))/sqrt(sum((y1-mean(y1)).^2)*sum((y2-mean(y2)).^2));
assert(isequal(your_fcn_name(y1,y2),y_correct))
y1 =
0
1
2
3
4
y2 =
2
3
4
5
6
|
Back to basics 25 - Valid variable names
293 Solvers
Return the first and last character of a string
3449 Solvers
Back to basics - mean of corner elements of a matrix
297 Solvers
Cumulative product of a vector
208 Solvers
111 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!