Frage

I have two matrix and want to get difference(Subtraction) b/w two matrix

e.g, IF

A = [2 4 6]
B = [1 1 1]

Answer should be

ans = [1 3 5]      % A-B

Note: (Its not a set difference..)

War es hilfreich?

Lösung

Just use one of the following in Matlab:

  1. A-B
  2. minus(A,B)

You will get:

ans =

    1     3     5

Check out here for more info.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top