필터 지우기
필터 지우기

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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by