Cody

Solution 1568613

Submitted on 25 Jun 2018 by J. S. Kowontan
  • Size: 28
  • 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.

Test Suite

Test Status Code Input and Output
1   Pass
x = [1:10]; y= [2 7 3 5 9 11 1 6 2 0]; y_correct = 3.3379 assert(isequal(BestFit(x,y),y_correct))

y_correct = 3.3379

2   Pass
sqft = [1200 1500 1750 2000 2250 2500 2750 3000 3500 4000]; avg_price= [ 135 142 156 165 170 220 225 275 300 450]; y_correct = 30.9322; assert(isequal(BestFit(sqft, avg_price),y_correct))

3   Pass
handicap = [6:2:24]; Score = [3.9400 3.8000 4.1000 3.8700 4.4500 4.3300 4.12 4.43 4.60 4.5000]; y_correct = 0.1508 assert(isequal(BestFit(handicap, Score),y_correct))

y_correct = 0.1508

4   Pass
x = [1:10]; y= x; y_correct = 0; assert(isequal(BestFit(x,y),y_correct))

5   Pass
x = [1:10]; y= zeros(1,10); y_correct = 0; assert(isequal(BestFit(x,y),y_correct))