How to write this expression in matlab ? Boolean logic
16 ビュー (過去 30 日間)
古いコメントを表示
( 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 ?
0 件のコメント
回答 (2 件)
Azzi Abdelmalek
2013 年 10 月 18 日
You can check yourself
p=[0 0 1 1],
q=[0 1 0 1]
p.^q
and(p,q)
or(p,q)
~p
~q
0 件のコメント
Jos (10584)
2013 年 10 月 18 日
you really should take a look at the logical operators & and | and ~ http://www.mathworks.nl/help/matlab/ref/logicaloperatorselementwise.html
(P & Q) | ~P
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!