Adding two matrices of different sizes?

A=[1 2 3 4;8 7 9 6 ;4 5 6 1]
B=[4 8 9 8 ;1 2 3 4 ]
how can i add A and B?

3 件のコメント

Adam
Adam 2017 年 6 月 9 日
編集済み: Adam 2017 年 6 月 9 日
What exactly are you expecting the result of such an addition to be? Define 'addition' in this context and give the expected result and it will likely be trivial. Otherwise, there is no definition of addition that I am aware of that works on different sized matrices of that form.
KSSV
KSSV 2017 年 6 月 9 日
YOu have to extend B's size to A either by padding zeros at first row or end row and then add.
Stephen23
Stephen23 2017 年 6 月 9 日
@ Bibhu Prasad Pala: of course this can be done, once you define what you mean by "Adding two matrices of different sizes". For example, matrix A has three rows, but matrix B has only two rows: what would you expect the values in the third row of A to be added to?

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

回答 (0 件)

カテゴリ

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

質問済み:

2017 年 6 月 9 日

編集済み:

2017 年 6 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by