can anyone tell me why this isnt working? i rounded to pass one test#.I understand this is a problem. But what else am i missing? precision problem? thanks
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 | Pass |
%%
x = [1:10];
y= x;
y_correct = 0;
assert(isequal(BestFit(x,y),y_correct))
A =
1.0000 0.0000
ans =
0
|
5 | Pass |
%%
x = [1:10];
y= zeros(1,10);
y_correct = 0;
assert(isequal(BestFit(x,y),y_correct))
A =
0 0
ans =
0
|
785 Solvers
220 Solvers
Remove the two elements next to NaN value
411 Solvers
856 Solvers
147 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!