MATLAB Answers

I Made

Exclusive or between two different matrix size ?

Asked by I Made
on 13 Mar 2013

I have two matrix A and B where e.g

A < 1 x 500 >

B < 1 x 32 >

i wanted to perform xor, but i wanted xor(A,B) only the first 32 element of A xor B so we don't have matrix size problem. The size of A and B is dynamic, basiccaly i wanted to perform xor(A,B) where the elemen of A that processed is the first elemen until it reach B size ? how do i perform xor like that so that the output become :

C < 1 x 32 >

can anyone help?




No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 13 Mar 2013
 Accepted answer

C = xor(A, B(1:length(A)))

  1 Comment

Thanks man, perfect.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!