将下列数据用matlab的插值算法制成三维曲线图G01,8457608.879156271,13771859.28188082,21340549.634021923 G01,-9051941.872652175,19204290.931452215,15956724.90917862 G01,14288658.076423738,-21468167.768726405,5399482.479929744
时间: 2023-05-30 12:05:11 浏览: 71
SKYLINE建模流程.doc
4星 · 用户满意度95%
首先将数据提取出来,并将其格式化为三个向量:
x = [8457608.879156271, -9051941.872652175, 14288658.076423738];
y = [13771859.28188082, 19204290.931452215, -21468167.768726405];
z = [21340549.634021923, 15956724.90917862, 5399482.479929744];
然后使用meshgrid函数生成三维网格:
[X,Y] = meshgrid(min(x):100:max(x), min(y):100:max(y));
接下来使用griddata函数进行插值计算,并使用surf函数生成三维曲面:
Z = griddata(x,y,z,X,Y,'linear');
surf(X,Y,Z);
最终的代码如下:
x = [8457608.879156271, -9051941.872652175, 14288658.076423738];
y = [13771859.28188082, 19204290.931452215, -21468167.768726405];
z = [21340549.634021923, 15956724.90917862, 5399482.479929744];
[X,Y] = meshgrid(min(x):100:max(x), min(y):100:max(y));
Z = griddata(x,y,z,X,Y,'linear');
surf(X,Y,Z);
xlabel('X');
ylabel('Y');
zlabel('Z');
title('G01三维曲线图');
阅读全文