how to do matrix multiplication

a = randi(0:1,10,5);
b = randi(0:1,32,32);
a =
1 1 0 0 1
0 0 1 0 1
0 1 0 0 0
0 1 1 1 0
0 1 1 1 0
0 0 1 1 1
1 1 0 1 1
0 1 0 0 0
0 0 1 0 0
0 0 0 0 0
I am trying to multiply 1st row with first 16 bits of matrix b and row 2 with next 16 bits of b and store result in matrix j
where 1st 16 bits on J matrix will be the output multiplication of row 1 of matrix a with row 1 to 16 of matrix b
Can someone please help me with this problem. I am trying to use for loop but having a hard time to deal with this critical problem.
Please help

3 件のコメント

Geoff Hayes
Geoff Hayes 2019 年 4 月 16 日
Ayesha - a is a 10x5 matrix and b is a 32x32 matrix. When you say first 16 bits of matrix b a do you mean the first sixteen columns of b? If so, how do you expect to multiply the first row of a, which is 1x5 with those sixteen columns? Please show an example.
Sajeer Modavan
Sajeer Modavan 2019 年 4 月 16 日
how a 10x5 matrix can multiple with 32x32. There is something wrong in your input
Walter Roberson
Walter Roberson 2019 年 4 月 16 日
Do you mean that you want to convert the first 16 bits of matrix b from binary to decimal, and multiply entries in a by that integer?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2019 年 4 月 15 日

コメント済み:

2019 年 4 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by