I am looking to plot this sinusoidal curve over just a desired range, from theta=120 to theta=150 here
It must be zero before 120 and after 150
The code is as written below,
x = 0:0.1:3.14;y = sin(x);theta = 0:360;if theta(theta(1,:)<120) && theta(theta(1,:)>150) yy = 0;else yy = y;endplot(theta,yy)
Its returning me errors saying,
Operands to the || and && operators must be convertible to logical scalar values.
How do i approach this problem?
Best Answer