How to write this expression in matlab ? Boolean logic

( P ^ Q ) or (~p) (p and q) or ( not p)
I do know that and(p,q) is P ^ q and that or(p,q) is P or Q
but how do I write the one i need ?

Answers (2)

You can check yourself
p=[0 0 1 1],
q=[0 1 0 1]
p.^q
and(p,q)
or(p,q)
~p
~q

Asked:

on 18 Oct 2013

Answered:

on 18 Oct 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!