Hello everybody.
I am trying to make an if loop but the problem is that "epsc" is undefined veriable.
Is there a better way to make it?
Thank you very much.
b=300; %mm
d=400; %mmfc=40; %Mpa
Ecshah=57000/145*(fc*145)^0.5; %MpaEs=200000; %MpaAs=2400; %mm^2
fy=400; %Mpaeps0=1.027*10^-7*fc*145+0.00195;epscu=3.5/1000;kshah=0.025*fc*10^3;A=Ecshah*eps0/fc;epscmv = linspace(0.05, 3.5, 500)*1E-3;for i=1:numel(epscmv); epscm = epscmv(i); if epsc<=eps0 funCshah=@(epsc) fc*(1-(1-epsc./eps0).^A); elseif epsc>eps0 funCshah=@(epsc) fc*exp(-kshah*(epsc-eps0).^1.15); endend compression=@(c) b*fc*c/epscm*integral(funCshah,0,epscm)/1000; tension=@(c) min(Es*(d-c)/c*epscm*As/1000,fy*As/1000); c(i)=fsolve(@(c) compression(c)-tension(c),1);
Getting the error:
Undefined function or variable 'epsc'.Error in Untitled (line 16) if epsc<=eps0
Best Answer