How to sequentially process the columns of a table?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dear Experts,
I have a table, tableA as shown below.
tableA
portfolio0 portfolio1 portfolio2 ... portfolio9 returns date
XX XX XX XX XX 199901
XX XX XX XX XX 199901
XX XX XX XX XX 199901
....
XX XX XX XX XX 199901
I can compute the total return for column 1 as
portfolio0 = tableB.portfolio0 .* tableB.returns.
However, when i do the following, I have an error. When I use
tableB.strcat('portfolio', 'i') = tableA.strcat('portfolio', 'i') .* tableA.returns where i = 0 to 9.
How do I process portfolio0 to portfolio9 together and store it like tableB as shown below.
tableB
portfolio0 portfolio1 ... portfolio2 date
XXX XXX XXX 199901.
In actual case, I will have tableA for different date and the processing are shown above. Hence the final tableB will look like
tableB
portfolio0 portfolio1 ... portfolio2 date
XXX XXX XXX 199901
XXX XXX XXX 199902
....
XXX XXX XXX 199912
Thank you so much for your advice LL
0 Kommentare
Antworten (1)
Siehe auch
Kategorien
Mehr zu Portfolio Optimization and Asset Allocation finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!