Question

Alright, I'm having a bit of an issue with a matlab problem:
http://www.chegg.com/homework-help/applied-numerical-methods-w-matlab-3rd-edition-chapter-3-problem-10-solution-9780073401102
I have two different m-files. The first is as follows:
function beamProblem(x),xx = linspace(0,x);
n=length(xx);
for i=1:n uy(i) = -5/6.*(sing(xx(i),0,4)-sing(xx(i),5,4)); uy(i)=uy(i) + 15/6.*sing(xx(i),8,3) + 75*sing(xx(i),7,2);
uy(i)= uy(i) + 57/6.*xx(i)^3 - 238.25.*xx(i);
endclf,plot(xx,uy,'--')
The second is:
function s = sing(xxx,a,n);if xxx > a s = (xxx - a).^n;
else s=0;
end
I get the following error when I try to run it:
"Error: File: beamProblem.m Line: 1 Column: 24
Unexpected MATLAB expression.a"
I just need help generating the plot. Thanks in advance!