Results 1 to 2 of 2

Math Help - matlab help

  1. #1
    Newbie
    Joined
    Nov 2009
    Posts
    19

    matlab help

    does anyone know how to calculate the magnitude of a vector in matlab? thanks
    Last edited by saha01; December 5th 2009 at 02:47 AM.
    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 saha01 View Post
    does anyone know how to calculate the magnitude of a vector in matlab? thanks
    If its a row vector

    Code:
    sqrt(x*x')
    if a column vector

    Code:
    sqrt(x'*x)
    If you don't want to worry about what sort of vector:

    Code:
    sqrt(sum(x.^2))
    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Matlab Help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 17th 2010, 08:13 AM
  2. Matlab
    Posted in the Math Software Forum
    Replies: 0
    Last Post: March 3rd 2010, 01:18 PM
  3. i need help in matlab
    Posted in the Math Software Forum
    Replies: 0
    Last Post: March 2nd 2010, 07:49 PM
  4. Matlab help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 21st 2009, 04:42 AM
  5. MATLAB
    Posted in the Math Software Forum
    Replies: 4
    Last Post: September 25th 2008, 01:47 PM

Search Tags


/mathhelpforum @mathhelpforum