I have an M X N matrix. The first column is number of nodes, the first row is interference range, and the data in the cell is slot value. I want to plot a graph using surf function.

4 views (last 30 days)
I want to use another variable number_of_pairs(e2:e7). That is, in total four variable. How can I plot my graph using 4-variables. Kindly, help me.

Answers (1)

Walter Roberson
Walter Roberson on 3 Oct 2015
number_of_pairs(e2:e7) adds (e7-e2+1) variables, not just one variable.
When you surf(), the properties that can be controlled per location are:
  • xdata
  • ydata
  • zdata
  • alphadata
  • cdata (vertex colors)
  • facenormals (for lighting)
  • vertexnormals (for lighting)
The alphadata can help distinguish between items that are close together, such as giving an impression of whether something is "above" or "below" something else (one will have an unbroken appearance but the other will be blurred at the points of overlap.) Alphadata cannot, however, be used comparatively between places that are not near each other on the graph, so its use as a full dimension is limited
The color data is normally by vertex, but can instead be configured as "texture map" to allow specific colors at specific locations.
Basically, color can be used to provide one relative and typically ambiguous dimension (how does bright pink compare to dark cyan for example?)
A difficulty with providing X, Y, Z, and color, is that it can be hard to see "into" the resulting 3 dimensional shape.
I therefore tend to recommend that people who need multiple dimensions to consider using scatter3(), which allows you to control X, Y, Z, pointsize, and color per location. When the pointsize is smaller than the resolution between adjacent X, Y, Z, then it is easier to see "into" the item.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!