Results 1 to 2 of 2

Math Help - More matlab help needed please

  1. #1
    Senior Member
    Joined
    Oct 2008
    Posts
    393

    More matlab help needed please

    I have a function

    x = 0:0.05:5.05
    eta = 2*rand()-1
    y = sin(x) + cos(x) + eta*0.1

    This plots a smooth curve where eta is a fixed value for every point from 0:0.05:5.05

    I want eta to change for every alue from 0:0.05:5.05

    How do i do this?
    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 adam_leeds View Post
    I have a function

    x = 0:0.05:5.05
    eta = 2*rand()-1
    y = sin(x) + cos(x) + eta*0.1

    This plots a smooth curve where eta is a fixed value for every point from 0:0.05:5.05

    I want eta to change for every alue from 0:0.05:5.05

    How do i do this?
    Code:
    x = 0:0.05:5.05
    eta = 2*rand(size(x))-1
    y = sin(x) + cos(x) + eta*0.1
    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Help needed in Syntax writing in MATLAB
    Posted in the Math Software Forum
    Replies: 4
    Last Post: March 2nd 2010, 10:49 PM
  2. Some help in matlab needed please
    Posted in the Math Software Forum
    Replies: 1
    Last Post: February 5th 2010, 11:01 AM
  3. Matlab Help needed
    Posted in the Math Software Forum
    Replies: 1
    Last Post: September 1st 2009, 09:33 PM
  4. Matlab-help needed
    Posted in the Math Software Forum
    Replies: 2
    Last Post: December 20th 2008, 01:39 PM
  5. MATLAB - matrice help needed
    Posted in the Math Software Forum
    Replies: 1
    Last Post: May 11th 2008, 06:01 AM

Search Tags


/mathhelpforum @mathhelpforum