Question: USE MATLAB TO SOLVE EQUATION: 3 . 1 9 Create a function called savings _ balance that determines the balance in a savings account at

USE MATLAB TO SOLVE EQUATION:
3.19 Create a function called savings_balance that determines the balance in a savings account at the end of every year for the first n years, where n is an input. The account has an initial investment A (for example, enter $10,000 as 10000) and an annual compounded interest rate of r%(for example, enter 3.5% as 3.5). Display the information in a table where the first column is Year and the second is Balance ( $ ).(Test case: n=10,A=10000,r=3.5. After ten years, the balance is $14,105.99.) With an initial investment of A and interest rate r, the balance B after n years is given by: B=A(1+r100)n
Approach
For this problem, the function can be expressed as an anonymous function rather than creating a function file. Instead of using an input command for the initial investment and interest rate, just initialize those variables using the values given for the test case. Initialize the time period to the test case values and then call the function to compute the balance for each year.
Create the formatted output as a table showing the year (formatted as an integer) and the balance (formatted with 2 decimal places) in columns. Include the appropriate column headings as specified in the problem statement.
USE MATLAB TO SOLVE EQUATION: 3 . 1 9 Create a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!