Here one if else loop is used. there i have used three conditions i want to use and operator…..means if all conditions are satisfied then it should display given function !
Sigma_x=-500;Sigma_y=-500;Sigma_xy=00;theta=0;o=(pi)*theta/180;T=[cos(o) -sin(o); -sin(o) cos(0)];Q= T*[Sigma_x Sigma_xy; Sigma_xy Sigma_y]/(T');Sigma1=Q(1,1);Sigma12=Q(1,2);Sigma2=Q(2,2);S1t=1300;S1c=-700;S2t=1200;S2c=-500;S6=600;S1=(S1c:S1t);S2=(S2c:S2t);plot(S1t,S2);hold on;plot(S1c,S2);hold on;plot(S1,S2t);hold on;plot(S1,S2c);plot(Sigma1,Sigma2,'*')axis([-800 1600 -800 1600])xlabel('Sigma1')ylabel('Sigma2')title('Maximum Stress Theory')if (S1c<Sigma1<S1t); and (S2c<Sigma2<S2t); and (0<Sigma12<S6); display('Its safe zone');else display('Material has yielded');end%end
Best Answer