How to write the below statements in matlab The statement is
How to write the below statements in matlab?
\"The statement is always false if both P and Q are true. Otherwise, the statement is true if Q is true but R is not true.\"
Solution
if you want to print the whole statement then you can you disp.
disp(\'The statement is always false if both P and Q are true. Otherwise, the statement is true if Q is true but R is not true.\')
and if you want it either way
you first assign the values for P and Q.
as if P is true then P =1
else P =0
similarly for Q and R
then write if else loop
if(P= Q = 1)
disp(\'the statement is always false.\')
else if(Q=1 and R = 0)
disp(\'the statement is true\')
