I want to print the statement "They are equal" if the left side equation is equal to the right side equation for x=200. This is the equation.
But when my program calculates the right side and left side equation, it does not execute the if statement even though the two sides are equal for x=200. This is my program:
clear, clc
x = 200;
left_side = (sin(x) + cos(x))^2;
right_side = 1+2*(sin(x)*cos(x));
if right_side == left_side
disp('they are equal')
end
I have tried debugging the program step by step and checked the values in memory after each step and nothing seems to be wrong.
But the if statement still does not execute. Is there anything I am missing? Thank you for your help.