MATLAB Numpy element wise multiplication issue

MATLAB Numpy element wise multiplication issue

Please see the MATLAB code and equivalent Numpy code below. Question: How can I get the D variable same in Numpy as MATLAB's?

Please see the MATLAB code and equivalent Numpy code below. Question: How can I get the D variable same in Numpy as MATLAB's?

MATLAB Code

A = [1 2 3; 4 5 6; 7 8 9]

C = [100 1; 10 0.1; 1, 0.01]

C = reshape(C, 1,3,2)

D = bsxfun(@times, A, C)

D(:,:,1) =

   100    20     3
   400    50     6
   700    80     9

D(:,:,2) =

1.0000    0.2000    0.0300
4.0000    0.5000    0.0600
7.0000    0.8000    0.0900

Numpy Code

A = np.array([[1,2,3],[4,5,6],[7,8,9]])

C = np.array([[[100, 1], [10, 0.1], [1, 0.01]]]) # C.shape is (1, 3, 2)

D = A * C.T

D

array([[[100.  , 200.  , 300.  ],
        [ 40.  ,  50.  ,  60.  ],
        [  7.  ,   8.  ,   9.  ]],

       [[  1.  ,   2.  ,   3.  ],
        [  0.4 ,   0.5 ,   0.6 ],
        [  0.07,   0.08,   0.09]]])


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Python: Issue reading in str from MATLAB .mat file using h5py and NumPy

I am having difficulty loading in 'str' variables 'Et' (Endtime) and 'St' (Starttime) from a MATLAB .mat file into Python.

Top Python Development Companies | Hire Python Developers

After analyzing clients and market requirements, TopDevelopers has come up with the list of the best Python service providers. These top-rated Python developers are widely appreciated for their professionalism in handling diverse projects. When...