문제

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