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
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook