Legend has it that in 1626, Peter Minuit purchased Manhattan Island for $24 in b
ID: 441417 • Letter: L
Question
Legend has it that in 1626, Peter Minuit purchased Manhattan Island for $24 in barter. Did he make a good investment? Write a MATLAB function M-file that takes as input an interest rate and returns as output the amount earned. Name it Manhattan. m. You should not use any Engineering Economics formulas-use a for loop. Then write a MATLAB script M-file that uses this function, and prints a table with two columns: interest rate, and amount earned. Vary the interest rate from 5% to 10%, in steps of 1%. Use fprintf to display a formatted table. Include titles on the columns. Upload the function M-file and the script M-file.Explanation / Answer
Please rate :) % this script file calculates the final balance % in a savings account that compounds % annually [initial_balance, interest_rate, num_years] = get_input; [final_balance] = calc_final_balance (initial_balance, interest_rate, num_years); display_result(final_balance); Example 5 (con't) get_input {no inputs; outputs need to be initial balance, interest rate and number of years} prompt for and read initial balance prompt for and read interest rate prompt for and read number of years function [init_bal, int_rate, num_yrs] = get_input % % get_input prompts for and returns the % three values entered by the user init_bal = input('Enter initial balance: '); int_rate= input('Enter the interest rate: '); num_yrs = input('Enter number of years ');
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.