How to plot a 3D surface in MATLAB?

I have a dataset like this:

| 0.1 0.2 0.3 0.4 ---------------------- 1 | 10 11 12 13 2 | 11 12 13 14 3 | 12 13 14 15 4 | 13 14 15 16 

I want to build a 3D surface graph in Matlab so that the column headers are on the y axis, the row headers are on the x axis, and the rest of the values ​​will determine the height of the point on the z axis.

I have looked at many examples, and I cannot figure out how to achieve this. At the moment, I have the following:

 Y = [0.1 0.2 0.3 0.4]; X = [1 2 3 4]; Z = [10 11 12 13; 11 12 13 14; 12 13 14 15; 13 14 15 16]; 

Please can someone help me?

+4
source share
2 answers
 surf(X,Y,Z) 

+4
source

Can the hatch schedule get the picture I want?

 Y = [0.1 0.2 0.3 0.4]; X = [1 2 3 4]; Z = [10 11 12 13; 11 12 13 14; 12 13 14 15; 13 14 15 16]; figure; bar3(Z) set(gca(gcf), 'xticklabel',{'0.1','0.2','0.3','0.4'}) 

3d plot

+1
source

Source: https://habr.com/ru/post/1383232/


All Articles