A=[1,2,3,4]
B=[7;8;9]
A (m1=1 by n1=4)
B (m2=3 by n1=1)
This gives a dimension mismatch meaning A*B is not allowed…
[A2,B2]=meshgrid(A,B)
Both A2 and B2 have the dimensions of m2 by n1
A matrix can be calculated by using element by element multiplication:
C2=A2.*B2
figure(1)
contour(C2)
colorbar
figure(2)
surfc(C2)
colorbar
A (m1=1 by n1=4)
A=[1,2,3,4]
B (m2=3 by n1=1)
B=[7;8;9]
A'
B'
A' (4 by 1)
B' (1 by 3)
Array Multiplication A'*B' is allowed as the dimensions match
C2=C1'