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

1 visualización (últimos 30 días)
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]

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Elementary Math en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by