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

2 Ansichten (letzte 30 Tage)
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]

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Elementary Math finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by