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일

0 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

태그

질문:

2020년 8월 28일

댓글:

2020년 8월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by