Cody

Solution 1011868

Submitted on 12 Oct 2016 by Gareth Lee
  • Size: 9
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

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 ans = 1

Suggested Problems

More from this Author27