how to create a matrix from a vector in this style
1 次查看(过去 30 天)
显示 更早的评论
So I have a vector e.g
P = [0.9 0.8] 1x2 vector
My outcome has to become Q =
0.9000 0.8000 0 0 0
0 0.9000 0.8000 0 0
0 0 0.9000 0.8000 0
0 0 0 0.9000 0.8000
So basically the row represent a year forecast, and the number is a pattern that has to be applied.
so i have a bit difficulty transforming this P vector into such a format. i.e that whenever the vector is moved one column that it has to add a zero column or something. I am trying to do this without for loops obviously.
best
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!