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

Another Matlab Problem

  1. Jan 20, 2008 #1
    I want to graph the equation [tex] z = x^{2} + (xy) [/tex] in matlab, but I cant figure out how to do it.

    Here is the code I am trying:

    EDU>> [X,Y] = meshgrid(-10:.5:10);
    EDU>> Z = X.^2 + X. * Y.;
    EDU>> mesh(X,Y,Z, 'EdgeColor', 'black')

    What am I doing wrong?
  2. jcsd
  3. Jan 21, 2008 #2
  4. Jan 21, 2008 #3


    User Avatar

    What makes you think you're doing something wrong?

    I can see one syntactical mistake (X. * Y.; should be X.*Y;) but otherwise it looks ok
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Another Matlab Problem
  1. Another Matlab problem (Replies: 4)

  2. Another Matlab : (Replies: 5)

  3. MATLAB problem (Replies: 1)