MATLAB: Getting syntax error when using for loop.

for loopMATLABparsesyntax

As title says; I am getting a syntax error when using the following code. The error points towards the d on "end"
F0=3.18;
m=0.0112;
k=31.2;
r1=0.22;
w0=sqrt(k/m);
w=linspace(0,400,400);
r=linespace(0.11,1.1,10);
for i=1:10
x0(:,i)=(F0/m)./(sqrt(((w0^2)-(w.^2))+((j*w*r(i)/m))));
end

Best Answer

r = linspace... % also consider preallocating x0