vector multiplication .* vs *
Matlab Video Tutorial: Multiplying Matrices and Vectors
But I don't understand how a. But why do the other two also produce the same result?
Due to implicit expansion introduced in b it's essentially the same as using bsxfun. But what does that mean?
By definition, bsxfun "applies the element-by-element binary operation specified by the function handle fun to arrays A and B, with singleton expansion enabled ". Newer MATLAB versions use implicit expansion, which basically means that a bsxfun equivalent is called 'under the hood' if necessary for a valid operation.
As you've noticed, this can be confusing if you don't keep track of your vector orientations! If you ever want to get a 1D output without expansion , then you can ensure your inputs are 1D column vectors by using the colon operator like so.
This should explain the identical result for a. Learn more. Element-wise mutiplication.
Select a Web Site
Asked 2 years, 2 months ago. Active 2 years, 2 months ago. Viewed times. Wolfie Lee Lee 1, 2 2 gold badges 12 12 silver badges 19 19 bronze badges.
Since Rb Newer MATLAB versions use implicit expansion, which basically means that a bsxfun equivalent is called 'under the hood' if necessary for a valid operation. Wolfie Wolfie The examples you listed are all element-wise multiplication.
Xiangrui Li Xiangrui Li 1, 2 2 gold badges 8 8 silver badges 14 14 bronze badges. I guess you mean Rb.
I'm still not clear why results of a. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.
Post as a guest Name. Email Required, but never shown.
element wise multiplication (beginner)
How to create micro-interactions with react-spring: Part 1. This week, StackOverflowKnows syntactic sugar, overfit or nah, and the….
Featured on Meta. Thank you, Shog9. Thank you, Robert Cartaino. Has Stack Exchange rescinded moderator access to the featured tag on Meta? How do the moderator resignations affect me and the community?