# multiplication of rows by range in a matrix

1 view (last 30 days)
Berfin Çetinkaya on 22 Mar 2022
Commented: Torsten on 22 Mar 2022
i have two matrices
matrix A:
50 44 80 0
50 0 80 52
50 0 80 52
49 49 2 2
matrix B:
5 4 9 7
10 3 10 6
If 1,2,3,4 or 5 is written in matrix b, multiply the last row in matrix A with the first row.
If matrix b says 6 or 7, multiply the last row in matrix A with the second row.
If 8 is written in matrix b, multiply the last row in matrix A with the third row.
However, let him continue this by examining both columns separately. It should return for each row of matrix B.And display them in a new matrix
For example the new matrix:
2450 2156 160 104
2450 132 160 104
Is such a code possible?
Thank u for help
##### 3 CommentsShow 2 older commentsHide 2 older comments
Torsten on 22 Mar 2022
It's possible, but you stated the rules differently.

Sign in to comment.

### Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!