In this regard, if there is a bug, it should be adjusted quickly:
n = 5; %5 years
RF(ii)= zero (n,1); % forwarding rate initialized to all zero column vector.
r =[2; 3; 3.7; 4.2; 4.5]; % ratio
t =[ 1:N]'; % Grade 1-5
for ii= 1:N
RF(ii+ 1)=(R(ii+ 1)* T(ii+ 1)-R(ii)T(ii))/(T(ii+ 1)-T(ii));
end
RFmx=[( 1:N)',RF]; % is expressed in two columns according to the requirements of the topic.