This is NOT the weighted average. The denominator should be the sum of the weights. PLEASE FIX THIS!!!
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [1 2 3];
w = [10 15 20];
y_correct = 100/3;
assert(isequal(weighted_average(x,w),y_correct))
|
2 | Pass |
x = [0 -2 3];
w = [10 0 10];
y_correct = 10;
assert(isequal(weighted_average(x,w),y_correct))
|
Find state names that end with the letter A
551 Solvers
Replace NaNs with the number that appears to its left in the row.
1710 Solvers
Make a random, non-repeating vector.
1115 Solvers
convert matrix to single column
217 Solvers
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
229 Solvers