How to create a matrix that contains members with specific different between each element ?

1 次查看(过去 30 天)
if I have matrix A that contains a distance between element n and n+1 :
A = [4 7 15]
How can I construct Matrix B that shows a result as
B = [1 5 12 27]

采纳的回答

per isakson
per isakson 2018-1-13
Starter:
>> cumsum([1,A])
ans =
1 5 12 27

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Elementary Math 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by