Matrix multiplication with each other.
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi!
I have a matrix [1 2 3 4 5 6 7 8] and I want to multiply 2 and 2 elements together, so 1*2 and 3*4 and 5*6 etc. What is the command to do so?
Answers (1)
yourvector(1:2:end) .* yourvector(2:2:end)
or
prod(reshape(youvector, 2, []))
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!