0

I have a set of data points, x, y, and z contained in a matrix, record.

In record, each row is a data-point where the first value is the x-coordinate, the second is the y-coordinate, and the third is the z-coordinate. I would like to represent this as a surface plot. I tried:

surf([record(:,1), record(:,2)], record(:,3))

But the results were not what I expected. Any advice?

horchler
  • 18,384
  • 4
  • 37
  • 73
MrD
  • 4,986
  • 11
  • 48
  • 90
  • 3
    It's hard to give advice without sample data, what you got, and an idea of what you were expecting. Unfortunately we're not yet omniscient. – sco1 Nov 10 '15 at 18:38

1 Answers1

-1

Try this code for instance.

[x,y,z]=sphere(n);
surf(x,y,z);
axis equal

This code plots with 3 parameters surf the surface of a sphere. As far as I understood from your code you want to utilize the 2 parameters surf for your application.

According to surf help when utilizing 2 parameters surf:

surf(Z) and surf(Z,C) use x = 1:n and y = 1:m.  In this case,
the height, Z, is a single-valued function, defined over a
geometrically rectangular grid.

where:

The color scaling is determined
    by the range of C

It just doesn't look like you want to utilize C as the color scaling parameter. For better understanding, can you send the contents of record for reference?

Prophet Daniel
  • 327
  • 2
  • 15
  • If I was able to leave a comment, indeed I would @excaza. Some people just voted down another post of mine downgrading my reputation(http://stackoverflow.com/questions/33631652/converting-to-jython-a-python-3-5-project-coding-error), I just don't know why. – Prophet Daniel Nov 10 '15 at 19:01
  • Not being able to comment does not mean you should post your comments as an answer. Build your reputation in other ways, it's not difficult. – sco1 Nov 10 '15 at 20:03