Asked by jasmine
In Matlab Write a function file that determines the following sum (for all odd n from 1 to 11):
y=Ó 2^n/n
y=Ó 2^n/n
Answers
Answered by
MathMate
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.
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.
Answered by
MathMate
* n=11, or Sum(11)
Answered by
Anonymous
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
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.