Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 227825

Submitted on 7 Apr 2013 by Claudio Gelmi

Correct

21Size
Leading solution size is 21.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
assert(abs(P(1)-1)<10*eps)

                    
2
Pass
 
%%
assert(abs(P(2)-exp(1)+2)<10*eps)

                    
3
Pass
 
%%
assert(abs(P(3)-0.563436343081910)<10*eps)

                    
4
Pass
 
%%
assert(abs(P(10)-0.228001515486442)<10*eps)

                    
5
Pass
 
%%
assert(abs(P(20)-0.123803830762570)<10*eps)

                    
6
Pass
 
%%
assert(abs(P(50)-0.052293638299222)<10*eps)

                    
7
Pass
 
%%
assert(abs(P(99)-0.026916294692673)<10*eps)