Multiplying cells within a matrix
显示 更早的评论
Hello I am very new to Matlab and have occurred a problem i can not seem to sort by myself.I have a very large matrix of simulated stock index returns and I want to convert the returns to simulated stock index values. I will use a small matrix to illustrate my problem;
A = [ 100, 100, 100; (1+0.04), (1+0.03), (1+0.1); (1+0.02),(1+0.07), (1+0.06)] The first row is the start value of the stock index, the second and third row are daily simulated stock returns. Each colummn is an simulation. My goal is to get a 2x3 matrix that shows the simulated value of the stock index at each day. In this example it would be: B=[100*(1.04), 100*(1+0.03), 100*(1+0.1); 100*(1.04)* (1+0.02), 100*(1+0.03)*(1+0.07), 100*(1+0.1)*(1+0.06)] I have tried for-loops but have not made any succcess.Sorry for not posting any code but I do not have anything that is close.. Would really appreciate any help Kind regards Sveinung Tyssedal
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!