ex10_1.m

来自「Programs for the book Advanced Engineeri」· M 代码 · 共 11 行

M
11
字号
% EX10_1.M MATLAB solution of the compound interest equation
%    y(nT)=y(nT-T) + (p/100)*y(nT-T)
%     for p = 6 percent and initial deposit y0 = $ 1000
%   y(n) represents the balance after the nth year 
clear
format bank    % Show results as currency
a=1.06;        % Calculation for 5 years at 6% interest
y0 = 1000      % Initial deposit 
for n=1:5
 y(n) = a^(n)*y0
end  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?