Cody

# Problem 2259. Best Fit RMS

Solution 438173

Submitted on 5 May 2014
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   Fail
%% 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))

Error: Assertion failed.

2   Fail
%% 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))

Error: Assertion failed.

3   Fail
%% 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))

Error: Assertion failed.

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

Error: Assertion failed.

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

ans = 0