a = rand; b = rand(10,10); scalar_matrix = a * b; component_wise = b .* b;