hej i have a vector Ta [12x1] and k [12x1] i would like to create a matrix [12,31] where the first column is Ta the second is Ta+k, the third is Ta+2k and so on till the end. can anyone help me with it or give any tip/hint

 采纳的回答

madhan ravi
madhan ravi 2020-8-28
编辑:madhan ravi 2020-8-28
Ta(:) + (k(:).' .* (1:31))
%Or
bsxfun(@plus, Ta(:), bsxfun(@times, k(:).', 1:31))

2 个评论

Test = Ta + (k .* (1:31)) - works perfectly... thank you a lot... i overthink and i started to writing some strange for loops
By the way don’t ask the same question multiple times.

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Test Execution 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by