simple code help
Here is my project:
write a matlab function n = P01(e) which does the following: find the smallest value of n such that: 1+1/2+1/3+...+1/n > e
where e > 1 is the input of the function and n is output.
and here is my code:
there is somethings wrong, please tell me
thank you
write a matlab function n = P01(e) which does the following: find the smallest value of n such that: 1+1/2+1/3+...+1/n > e
where e > 1 is the input of the function and n is output.
and here is my code:
function n = P01pham( e ) %Find the smallest value of n such that % 1 + 1/2 + 1/3 +...+ 1/n > e n = 1; b = 0; While ( n > e ) n = n + 1/b; b = b + 1; end
there is somethings wrong, please tell me
thank you
0
Comments