Problem 45960. Set the Euler-Mascheroni constant with an identity using available MATLAB functions

Solution 2573217

Submitted on 17 Jun 2020 by Tim
  • Size: 13
  • 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
y_correct = 0.5772156649; assert(isequal(EulerMascheroni,y_correct))

ans = 0.5772

2   Pass
filetext = fileread('EulerMascheroni.m'); summing = ~isempty(strfind(filetext, 'sum')) || ~isempty(strfind(filetext, 'plus')) ||... ~isempty(strfind(filetext, '+')); assert(~summing, 'Please do not sum infinite series')

3   Pass
filetext = fileread('EulerMascheroni.m'); assert(isempty(strfind(filetext, '5772156649')), 'Please do not set the constant directly (or indirectly with arithmetic')

Suggested Problems

More from this Author50

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!