creating a matrix from vector

2 ビュー (過去 30 日間)
Aleksandra Ksiezyk
Aleksandra Ksiezyk 2020 年 8 月 28 日
コメント済み: madhan ravi 2020 年 8 月 28 日
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 件のコメント
Aleksandra Ksiezyk
Aleksandra Ksiezyk 2020 年 8 月 28 日
Test = Ta + (k .* (1:31)) - works perfectly... thank you a lot... i overthink and i started to writing some strange for loops
madhan ravi
madhan ravi 2020 年 8 月 28 日
By the way don’t ask the same question multiple times.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by