MATLAB homework help request
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I need help with this question!
The lump sum S to be paid when interest on a loan is compounded
annually is given by S = P(1 + i)n where P is the principal invested,
i is the interest rate, and n is the number of years. Write a function
interest.m that will plot the amount S as it increases through the
years from 1 to n. The main function will call a function to prompt
the user for the number of years (and error-check to make sure that the
user enters a positive integer). The function will then call a function
that will plot S for years 1 through n. It will use .05 for the interest
rate and $10,000 for P.
0 comentarios
Respuestas (2)
Image Analyst
el 21 de Oct. de 2012
Check out input() or better, inputdlg(). Then check out plot().
11 comentarios
Walter Roberson
el 22 de Oct. de 2012
The discussion of your other question should happen in your other question.
Matt J
el 21 de Oct. de 2012
Editada: Matt J
el 21 de Oct. de 2012
Should be easy. Use the INPUT command to get the user input. Then
if isnumeric(n) && isreal(n) && n>=0
etc...
end
Then apply the compounding formula. Then the PLOT command.
4 comentarios
Matt J
el 21 de Oct. de 2012
I do not. However, you can step through the code 1 line at a time and examine the results by setting breakpoints
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!