plot surface 3d from table

5 次查看(过去 30 天)
hi everyone
i have this table
0.04 0.06 0.08 0.1 0.12 0.15
20 1112 1239 1349 1432 1505 1629
16 1003 1115 1195 1264 1322 1415
10 836.3 917.3 978.6 1035 1075 1145
8 782.7 840.1 904 954 996 1056
7 734.9 804.1 864.1 911.7 949.8 1015
5 836.3 721 772.4 815.1 859.5 922.4
i want the same plot in matlab
surface 3d
can some one help me

采纳的回答

Dyuman Joshi
Dyuman Joshi 2023-9-22
Import the data, assign the first column as x data, top row as y data (or vice-versa, depending upon how you define the axis) and the remaining matrix as the z data, and then use surf.
%That would look like
x = [20 16 10 8 7 5];
y = [0.04 0.06 0.08 0.1 0.12 0.15];
z = [1112 1239 1349 1432 1505 1629;
1003 1115 1195 1264 1322 1415;
36.3 917.3 978.6 1035 1075 1145;
782.7 840.1 904 954 996 1056;
734.9 804.1 864.1 911.7 949.8 1015;
836.3 721 772.4 815.1 859.5 922.4 ];
surf(x,y,z)
set(gca,'XDir','reverse', 'YDir', 'reverse')
view([45 45])

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by