Filter löschen
Filter löschen

Adding two matrices of different sizes?

4 Ansichten (letzte 30 Tage)
Bibhu Prasad Pala
Bibhu Prasad Pala am 9 Jun. 2017
Bearbeitet: Walter Roberson am 10 Jun. 2017
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 Kommentare
KSSV
KSSV am 9 Jun. 2017
YOu have to extend B's size to A either by padding zeros at first row or end row and then add.
Stephen23
Stephen23 am 9 Jun. 2017
@ 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?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by