Problem 195. Program an exclusive OR operation with logical operators
Solution Stats
Problem Comments
Solution Comments
-
1 Comment
A C
on 20 Jul 2018
Can you show me how to write an if statement for this?
I have it in my code. It will not work for the last test.
% this if statement would not work with a=[0 0 1 1];b=[1 0 1 0];.
%if (a==0 & b~=0) || (b==0 & a~=0)
%i = 1;
%else
%i = 0;
%end
%y = i;
-
1 Comment
Varoujan
on 3 Jun 2015
Problem statement was not specific and didn't indicate the inputs a, b could be vectors.
-
1 Comment
Richard
on 1 Mar 2013
Sorry, I just wondered if xor was somehow restricted on this cody . . . I guess not.
-
1 Comment
Trung Duong
on 9 Feb 2012
just wonder how do you check people using xor() or not, :)
-
1 Comment
@bmtran (Bryant Tran)
on 31 Jan 2012
sent from my iPhone.
Problem Recent Solvers690
Suggested Problems
-
1349 Solvers
-
259 Solvers
-
474 Solvers
-
643 Solvers
-
Find out sum of all elements of given Matrix
447 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!