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