PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU WANT ANY MODIFICATION LIKE FOR SEPERATE FILE, THEN DO LET ME KNOW
function [ N ] = readNYears
N = input('Enter a positive integer for n: ');
while N ~= fix(N) | N < 0
N = input('Please try again, enter a postive integer for n: ');
end
end
function plotLumpSum(n)
int = 0.05;
P = 10^4;
Y = 1:n;
S = P*(1+int).^Y;
plot(Y,S,'r-*')
xlabel('Year')
ylabel('Lump Sum S')
title('Plot of S for years 1 through n')
end
n = readNYears;
plotLumpSum(n)
Get Answers For Free
Most questions answered within 1 hours.