function fcnscripts
clear all
r=sumofcubes(20);
fprintf('The sum of the first 20 cubes is %i\n',r)
disp('Press any key to continue')
pause

g=inline('cos(x)+cos(1.1*x)')
x=0:0.01:100;
y=g(x);
plot(x,y)
disp('Press any key to continue')
pause

gg=inline('cos(x)+cos(delta*x)','x','delta')
delta=1.05
y=gg(x,delta);
plot(x,y)
title('inline function')
disp('Press any key to continue')
pause

x=0:0.01:100;
delta=1.05
ggg=@(x, delta) cos(x)+cos(delta*x)
y=ggg(x, delta);
plot(x,y)
title('anonymous function')
%
function r=sumofcubes(N)
ans=0;
for i=1:N
    ans=ans+i^3;
end
r=ans;
