Really Simple Matrix Multiply Question
1 view (last 30 days)
Show older comments
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
0 Comments
Answers (2)
Paulo Silva
on 3 Dec 2011
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))
0 Comments
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!