Question: Can I ask what is wrong with the codes? My answer did not show the values on the table, only says 1x7 table 12 The
Can I ask what is wrong with the codes? My answer did not show the values on the table, only says 1x7 table



12 The remaining loan balance, B, of a fixed payment n years mortgage after x years is given by: 1(1+)2"-(1+)2 B= (1+ i) 2n-1 where L is the loan amount, and r is the annual interest rate. Calculate the balance of a 30-year, $100,000 mortgage, with annual interest rate of 6% (use 0.06 in the equation) after 0, 5, 10, 15, 20, 25, and 30 years. Create a seven-element vector for x and use element-by-element operations. Display the results in a two-row table where the values of years and balance are dis- played in the first and second rows, respectively. %This m.file calculates values of years and balance %Loan amount L = 100000; %Annual Interest Rate r = 0.06; Mortgage Year 30; n = %Vector of Time Period (Years) x = [0:5:30]; %The remaining loan balance, B , B % of a fixed payment n-year mortgage after x years B=L*(((1+(r/12)).^(12.*n)(1+(r/12)).^(12.*x))./(((1+(r/12)).^(12.*n)-1))); %For printing table, the values of years and balance % are displayed in the first and second rows, respectively Years=x; Balance=B; table(Years, Balance) Command Window ans = 1x2 table Years Balance 1x7 double 1x7 double fx
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
