필터 지우기
필터 지우기

How can I multiply a row vector with each of two column vectors?

조회 수: 3 (최근 30일)
wd w
wd w 2024년 2월 19일
댓글: wd w 2024년 2월 19일
I have a row vector and two column vectors, and intend to perform their multiplication (element by element). The following is an example.
t = [1 2];
s = [(1:3)',(4:6)'];
The expected result:
1 2 4 8
2 4 5 10
3 6 6 12

채택된 답변

Dyuman Joshi
Dyuman Joshi 2024년 2월 19일
t = [1 2];
s = [(1:3)',(4:6)'];
out = kron(s,t)
ans = 3x4
1 2 4 8 2 4 5 10 3 6 6 12

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 NaNs에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by