MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/cmdbuf/pythons_response_to_matlab/ew387bp
r/Python • u/Alexanderdaawesome • Aug 05 '19
372 comments sorted by
View all comments
Show parent comments
4
Tensor operations are very easy with MATLAB. It’s just like any other matrix operation. I have no idea where you got this idea that you had to loop when N>2.
0 u/[deleted] Aug 06 '19 [deleted] 1 u/mexiKobe Aug 06 '19 edited Aug 06 '19 did you try using repmat in the first example on V or something like that? and your 2nd example can almost certainly be vectorized from glancing at ithttps://www.mathworks.com/help/matlab/matlab_prog/vectorization.htmlYou should also look into bsxfun 0 u/[deleted] Aug 06 '19 [deleted] 1 u/mexiKobe Aug 06 '19 Do you remember the numpy code?
0
[deleted]
1 u/mexiKobe Aug 06 '19 edited Aug 06 '19 did you try using repmat in the first example on V or something like that? and your 2nd example can almost certainly be vectorized from glancing at ithttps://www.mathworks.com/help/matlab/matlab_prog/vectorization.htmlYou should also look into bsxfun 0 u/[deleted] Aug 06 '19 [deleted] 1 u/mexiKobe Aug 06 '19 Do you remember the numpy code?
1
did you try using repmat in the first example on V or something like that? and your 2nd example can almost certainly be vectorized from glancing at it
repmat
https://www.mathworks.com/help/matlab/matlab_prog/vectorization.html
You should also look into bsxfun
bsxfun
0 u/[deleted] Aug 06 '19 [deleted] 1 u/mexiKobe Aug 06 '19 Do you remember the numpy code?
1 u/mexiKobe Aug 06 '19 Do you remember the numpy code?
Do you remember the numpy code?
4
u/mexiKobe Aug 06 '19 edited Aug 06 '19
Tensor operations are very easy with MATLAB. It’s just like any other matrix operation. I have no idea where you got this idea that you had to loop when N>2.