Question: The exponential function can be calculated or approximated using the following series: where n ! is the factorial of n . The greater the n
The exponential function can be calculated or approximated using the following series:
where n! is the factorial of n. The greater the n value, the "better" the approximation. Using a for( ) loop with the series equation above, and the function factorial( ), write a MATLAB program to determine e1.56, assuming n = 5 and display the result.
Also include in your program the exact result using the exp( ) function in MATLAB and display it. When running your program, only these two results should be displayed. (Note: to raise x to the nth power, the caret symbol ^ should be used: x^n.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
