Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Problem with drawing a function in MATLAB

  1. Dec 17, 2009 #1
    hi guys ,

    I'm trying to draw the following function , however MATLAB doesn't like my code . What am I doing wrong ?

    z = x + (y – 100)^2

    where x = -50 : 50,
    y = 0 : 200


    my code :

    [x,y]=meshgrid(-50:1:50,-0:1:200)
    surf(x , y , x. + (y.-100)^2)


    thank you
     
  2. jcsd
  3. Dec 17, 2009 #2
    You have the dots in the wrong place
    Code (Text):

    surf(x , y , x + (y-100).^2)
     
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Problem with drawing a function in MATLAB
Loading...