MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Todayinner product of two vectors

724 correct solutions
1198 incorrect solutions

Last solution submitted on Dec 20, 2014

1 player likes this problem

3 Comments

Daniel Pereira
on 16 Apr 2013

Why is this smaller than just x*y'?

Carlos Adrian Vargas Aguilera
on 1 Jul 2013

NOt just that, his output is y instead of z!! jajaj...

Mineralter
on 30 Sep 2013

That is the matrix attribute!

1 Comment

Harish Maradana
on 23 Nov 2012

i wrote solution like below
z = sum(x.*y);
it is working on my laptop but in cody show incorrect tell me why

3 Comments

Bryce
on 2 Feb 2012

Hmmm, description is a little confusing. Is length(x) always = length(y)? Are they nx1 or 1xn? Anyhow, I submitted several possible solutions (e.g. z = x'*y, z = sum(x.*y)) all of which failed the test suite ... but they work fine on my machine!

David Young
on 3 Feb 2012

Note that the output variable in the pattern is y, not z.

Stephen
on 1 Mar 2012

ha, yeah. thanks for commenting about that. I didn't see it either.

4 Comments