Hi, I'm trying to write a loop where my data enters into either 1 of 2 equations depending on the condition but when I run it, it says that variable 'y' is not recognised and I don;t know why
Here is what I did and I can't figure out what I did wrong
L=25;E=200^9;I=350^(-6);w=6^3;x=linspace(0,28,51);for i=0:51 if x>=0 & x<=L/2 y=-((w.*x)./(348.*E.*I)).*((16.*x.^3)-(24.*L.*x.^2)+(9.*L^3)); elseif x>=L/2 & x<=L y=-((w.*x)./(384.*E.*I)).*((8.*x.^3)-(24.*L.*x.^2)+(17.*L^2.*x)-(L^3)); endendplot(x,y)
Here is a screenshot of my question of what I'm trying to do here
Best Answer