cumprod row and column

3 Ansichten (letzte 30 Tage)
Mate 2u
Mate 2u am 6 Jun. 2012
Hi there, I have a matrix of size 1000x 40. The 1000 represent weeks and 40 represent the number of assets. For each entry is a percentage of money made or lost.
I want to do the cum prod horizontally (all assets for one week), then cumprod going doing. So I have a full return for all assets.
Any help would be appreciated.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 6 Jun. 2012
cumprod(cumprod(YourMatrix,2))

Weitere Antworten (0)

Kategorien

Mehr zu Linear Algebra 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