Matlab画图 X Y上不同个点的数据和对应Z的数据 怎么画三维曲面图?

2024-11-30 19:58:55
推荐回答(1个)
回答1:

X=[2,4,6,7,8]; Y=[0.4,0.6,0.8,0.9,1.0,1.2,1.4,2.0,3.10,4.3,5.5,6.0,7.0];
>> Z=[0.446,0.419,0.229,0.688,0.012;
0.457,0.473,0.400,0.396,0.372;
0.463,0.471,0.497,0.417,0.431;
0.504,0.492,0.475,0.140,0.519;
0.837,0.894,0.774,0.778,0.392;
0.997,0.637,0.928,0.881,0.061;
0.751,0.719,0.711,0.692,0.669;
0.658,0.639,0.675,0.655,0.617;
0.533,0.507,0.552,0.533,0.530;
0.4572,0.438,0.476,0.470,0.464;
0.466,0.145,0.748,0.439,0.423;
0.371,0.389,0.432,0.445,0.489;
0.349,0.374,0.378,0.444,0.442];
>> [X,Y]=meshgrid(X,Y);
>> surf(X,Y,Z)
数据太少,绘制出来的图形效果不太好。