Really Simple Matrix Multiply Question

조회 수: 1 (최근 30일)
James
James 2011년 12월 3일
A = [1,5,6,3,2,1] B = [3,4,6]
I want to take each element in A and multiple it by all the elements in B. For example I want C = [3,4,6,15,20,30,18,24...]
I know this is really simple, I'm just missing it in the hlep.
Thanks much,
James

답변 (2개)

Grzegorz Knor
Grzegorz Knor 2011년 12월 3일
Kronecker tensor product:
kron(A,B)

Paulo Silva
Paulo Silva 2011년 12월 3일
Yet another possible solution
A = [1,5,6,3,2,1]
B = [3,4,6]
C=cell2mat(arrayfun(@(X)times(A(X),B),1:numel(A),'uni',0))

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by