Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For MATLAB programming Write a function called approx euler that uses the following formula to compute e, Euler's number: 1. k! 2 6 24 Instead
For MATLAB programming
Write a function called approx euler that uses the following formula to compute e, Euler's number: 1. k! 2 6 24 Instead of going to infinity, the function stops at the smallest k for which the difference between exp (1) (i.e., the value returned by MATLAB's built-in function) and e becomes less than or equal to the positive scalar, delta, which is the only input argument. The first output of the function is the approximate value of e and the second is k. C on your keyboard.) You are not allowed to use the built-in function factorial but creating your own function 'fact' to calculate factorial might help! Hint: Initialize the values of e, k and sum (or any variable in which you would store sum) equal to1 before starting the while loop and then in the while loop, K would be incremented. Example: if delta -0.5 then e 2.5000 and k 3Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started