Cody

Problem 45779. Variance computation (★★★)

Solution 3197976

Submitted on 13 Oct 2020 by TurqoiseInt
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
x = [-1, 3, 5, -4, 10, 12]; y_correct = 38.16666666666667; assert(isequal(your_fcn_name(x),y_correct)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'std')),'std forbidden') assert(isempty(strfind(filetext, 'var')),'var forbidden') assert(isempty(strfind(filetext, 'mean')),'var forbidden')

2   Pass
x = 1:10; y_correct = 9.166666666666666; assert(isequal(your_fcn_name(x),y_correct)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'std')),'std forbidden') assert(isempty(strfind(filetext, 'var')),'var forbidden') assert(isempty(strfind(filetext, 'mean')),'var forbidden')

3   Pass
x = primes(30); y_correct = 81.43333333333334; assert(isequal(your_fcn_name(x),y_correct)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'std')),'std forbidden') assert(isempty(strfind(filetext, 'var')),'var forbidden') assert(isempty(strfind(filetext, 'mean')),'var forbidden')