How do I multiply specific numbers in two different matrices by each other?

1 view (last 30 days)
So for instance, If I had:
A=[1 2 3]
B=[4 5 6]
How would I compute 3*5 to get 15? (I'd like to know how to do this for any operator not just multiplication)

Accepted Answer

Image Analyst
Image Analyst on 8 Sep 2020
Just use indexing, as like any other programming language, for example
output = A(3) * B(2)
Replace * with / or + or whatever operator you want.

More Answers (0)

Tags

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!