Results 1 to 6 of 6

Math Help - Matlab Help sequence

  1. #1
    Junior Member
    Joined
    Feb 2009
    Posts
    29

    Matlab Help sequence

    Write a sequence of commands that compute and display the sum of the numbers from 1 to 20, each raised to the fifth power.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Mathhelpz View Post
    Write a sequence of commands that compute and display the sum of the numbers from 1 to 20, each raised to the fifth power.
    So what have you done?

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Feb 2009
    Posts
    29
    im thinking


    for i = 1:20
    x = 5
    y = i^x
    end
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Mathhelpz View Post
    im thinking


    for i = 1:20
    x = 5
    y = i^x
    end
    Have you tried running that code?

    CB
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Junior Member
    Joined
    Feb 2009
    Posts
    29
    clear
    clc
    x = 5;
    for i = 1:20
    y = i^x
    end

    I tested it and seems like all numbers all raised to the fifth power from 1 to 20. How do I display the sum of all of it???
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Mathhelpz View Post
    clear
    clc
    x = 5;
    for i = 1:20
    y = i^x
    end

    I tested it and seems like all numbers all raised to the fifth power from 1 to 20. How do I display the sum of all of it???
    sum([1:20].^5)

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: August 29th 2011, 07:49 PM
  2. Replies: 0
    Last Post: July 4th 2010, 01:05 PM
  3. matlab code asap thanks Fibonacci sequence
    Posted in the Math Software Forum
    Replies: 1
    Last Post: October 18th 2009, 08:50 PM
  4. sequence membership and sequence builder operators
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: June 4th 2009, 04:16 AM
  5. [Matlab] 2D Sequence Plot in 3D
    Posted in the Math Software Forum
    Replies: 2
    Last Post: April 23rd 2009, 05:28 AM

Search Tags


/mathhelpforum @mathhelpforum