%prog.m   --   Some basic programming elements in Matlab

%For loop
sum=0.0;
for i=1:10
    sum=sum+i;
end

%While loop
x=0;
while (x<10)
    x=x+1;
end

%If statements
if x==10
    y=10;
end

if y==10
    x=0;
elseif x==5
    x=2*y;
else
    x=4*y;
end

if x==10 && y==0
end

if x~=10
end