0
votes

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?

1
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. - excaza

1 Answers

-1
votes

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?