1. Engineering
  2. Computer Science
  3. who can help me to solve it...

Question: who can help me to solve it...

Question details

Who can help me to solve it?

Create a script with an appropriate name which: computes the number e-2.718.. to 8 decimal places. You may NOT use the Matlab exp(1) command! However, you may and should use Matlabs factorial, command. Use a ‘while loop structure. Make sure the script prompts the user for a maximum number of iterations. The script should either display the answer, or a message noting that the maximum iterations have been reached. Display the results of at least two cases, one where the algorithm succeeds and one where the maximum iterations are reached. Use a variation of %6.2f in your fprintf command so that e to the desired number of decimal places is displayed.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution