Calculate value based on previous row plus adjacent row

Hi,
I have a matrix of two columns and need to calculate the values of the second column based on the previous row of column 2 plus the adjacent row of column 1. For example,
Given the above matrix, cell B4 has been calculated by getting the value of cell B3 + A4. This carries on for the duration of the matrix.
I can do this quite easily in Excel but am finding it rather difficult in Matlab.
Any help/suggestions would be greatly appreciated please.

类别

帮助中心File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

提问:

2016-7-19

回答:

2016-7-19

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by