Multiply x sequentially with items of a vector
1 回表示 (過去 30 日間)
古いコメントを表示
Dear MATLAB community,
I would like to construct an index, which should start with 100. I have computed a vector, which then determines the change in the index in each time period. For example, for 4 time periods:[1.1,1.2,1.3,1.4] Basically, the operation should compute and produce the following vector:
- 100*1.1
- (100*1.1)*1.2
- ((100*1.1)*1.2)*1.3
- (((100*1.1)*1.2)*1.3)*1.4
Thank you very much in advance! I appreciate any help, as I am still a beginner with MATLAB.
0 件のコメント
採用された回答
その他の回答 (1 件)
Walter Roberson
2015 年 8 月 7 日
編集済み: Stephen23
2015 年 8 月 7 日
cumprod([100, 1.1, 1.2, 1.3, 1.4])
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!