MatLab

In Matlab Write a function file that determines the following sum (for all odd n from 1 to 11):
y=Ó 2^n/n

  1. 👍 0
  2. 👎 0
  3. 👁 202
  1. 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.

    1. 👍 0
    2. 👎 0
  2. * n=11, or Sum(11)

    1. 👍 0
    2. 👎 0
  3. function [S] = Sum(n)
    sum=0;
    for i=1:n:2
    sum=sum+2^i/i;
    end
    S=sum;
    end

    1. 👍 0
    2. 👎 0

Respond to this Question

First Name

Your Response

Similar Questions

  1. Calculus, check my answers, please? :)

    Okay, so I think these are right, but I would appreciate if someone could check them and tell me if something is wrong and what the right answer is. I'd also appreciate an explanation if possible. :)Thank you! 7. Given that

    asked by Samantha on October 2, 2013
  2. pre cal

    Determine algebraically whether the function is even, odd, or neither even nor odd. f as a function of x is equal to 14 times the cube root of x

    asked by Jorgeeee on June 23, 2014
  3. math check

    Posted by TchrWill on Thursday, July 14, 2005 at 5:44pm. 2.)The sum of four consecutive odd integers is -336. Set up an equation AND solve for all of the integers. Two ways to approach this. -336/4 = -84 making the 4 consecutive

    asked by angel on July 17, 2005
  4. Calculus, check my answers, please! 3

    Did I get these practice questions right? 1. Suppose that f is an even function whose domain is the set of all real numbers. Then which of the following can we claim to be true? ***The function f has an inverse f –1 that is

    asked by Samantha on October 2, 2013
  5. Pre-Calculus

    A Ferris wheel has a radius of 40 feet. The bottom of the Ferris wheel sits 0.7 feet above the ground. You board the Ferris wheel at the 6 o'clock position and rotate counter-clockwise. a.) Write a function f that determines your

    asked by Fernando on February 15, 2020
  1. Math 130

    Sum the first two odd numbers, then the first three, the first four, and so on. From these observations could you guess the sum of the first 100 odd numbers?

    asked by Enis on February 27, 2013
  2. Algebra

    The sum of two consecutive odd integers is 56. A. Define a variable for the smaller integer. B. What must you add to an odd integer to get the next greater odd integer? C. Write an expression for the second integer. D. Write and

    asked by Bri on October 14, 2011
  3. college algebra

    Let f denote an odd function and g an odd function. Decide whether the function h(x)=g(x) f(x) is even or odd.

    asked by rodrigo on December 7, 2007
  4. Computer science

    How to convert from decimal to binary in matlab.....this is what I have so far..... dec = 43; i = 1; sum=0; while dec>0 r = rem(dec, 2); sum=sum+(i*rem); dec=dec/2; i=i*10; end sum

    asked by jm on March 25, 2015
  5. Math

    make a conjecture for the following show work the sum of an even and odd number. - the product of two odd numbers.

    asked by Geometry Help!!!! on September 15, 2011
  6. Math

    One number is 10 larger than another. Write a function in standard form to represent the sum of their squares. The minimum sum of squares is ___. So I said that the function is f(x)=x^2+x+10 and since the question comes from an

    asked by Emily J on March 16, 2016

You can view more similar questions or ask a new question.