1, user-defined function, fun(n)
Function S = fun (n)
s = 1;
For i= 1:n
S = S+ 1/(2 * I);
end
2. Enter in the command window.
S = fun( 100)