Suppose I have two column vectors:
J = j x 1 vector
K = k x 1 vector
And I want to create a j x k matrix, W:
W = j x k matrix
where the columns of W are formed by multiplying the corresponding element of K by the vector J.
The for loop to create W looks like this :
W = zeros(length(J),length(K));
for i = 1:1:length(K)
W(:,i) = K(i)*J;
should result in
Is there any way I can avoid the for loop here? Thanks!