Вопрос

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..)

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top