I have a problem using the if statement. When I plot the it individually, it was fine.
but when I attempt to combine the plots with if statement, it just doesn't seem right.
Please help me, I'm stuck!!!! Here's my script:
function [x1,x2,x3,x4]=BurnFraction_2()clear();a = 5;n = 4;thetas = [-50 -20 0 20];thetad = 60;for i = 1:4;theta=linspace(thetas(i),thetas(i)+thetad,100);dum=(theta-thetas(i))/thetad;temp=-a.*dum.^n;xb=1-exp(temp); if i == 1 x1 = xb; end if i == 2 x2 = xb; end if i == 3 x3 = xb; else x4 = xb; endend;plot(theta,x1,'-',theta,x2,'--',theta,x3,'.',theta,x4,'-.','linewidth',5);set(gca,'Xlim',[-60 80],'Ylim',[0 1],'fontsize', 18,'linewidth',2);xlabel('Crank Angle (°)','fontsize', 18);ylabel('Cumulative Burn Fraction','fontsize', 18);end
Thank you! I really appreciate it!!!
Best Answer