Do you mean
y=Σ 2^n/n for n=1,3,...11
?
If you are already familiar with the syntax of Matlab, you can use the following pseudocode:
function [S] = Sum(n)
sum=0;
for i=1:n:2
sum=sum+2^i/i;
end
S=sum;
end
The calling program has to supply i=11 to evaluate the required expression.
In Matlab Write a function file that determines the following sum (for all odd n from 1 to 11):
y=Ó 2^n/n
3 answers
* n=11, or Sum(11)
function [S] = Sum(n)
sum=0;
for i=1:n:2
sum=sum+2^i/i;
end
S=sum;
end
sum=0;
for i=1:n:2
sum=sum+2^i/i;
end
S=sum;
end