Info
此问题已关闭。 请重新打开它进行编辑或回答。
how can i make my scattered 3 dimensional data points as a 3d surface?
1 次查看(过去 30 天)
显示 更早的评论
I am having the matrix k where each row represents a 3dimensional point.Each column of the matrix represents the respective dimensional value of each point.How can i make the 3d surface for the matrix?Kindly need help as soon as possible. >> k
k =
1.0e+03 *
0.0124 8.6000 0.0308
0.0099 9.8400 0.0355
0.0108 8.3200 0.0347
0.0118 8.0800 0.0490
0.0127 8.5800 0.0327
0.0133 7.8600 0.0438
0.0141 8.1600 0.0322
0.0102 8.1800 0.0490
0.0101 8.6800 0.0322
0.0134 8.1000 0.0372
0.0134 8.3000 0.0338
0.0130 7.3600 0.0550
0.0137 7.1200 0.0323
0.0096 9.1200 0.0372
0.0179 7.4800 0.0283
0.0100 8.4900 0.0372
Thanks in advance.
0 个评论
回答(1 个)
Alessandro Masullo
2015-1-27
tri = delaunay(k(:,1),k(:,2));
trisurf(tri,k(:,1),k(:,2),k(:,3))
2 个评论
Alessandro Masullo
2015-2-5
The surface in your image is provided on a regular grid, while your data are not. You need to interpolate your data on a structured grid (created with meshgrid) using scatteredInterpolant.
k = 1.0e+03 *[ 0.0124 8.6000 0.0308
0.0099 9.8400 0.0355
0.0108 8.3200 0.0347
0.0118 8.0800 0.0490
0.0127 8.5800 0.0327
0.0133 7.8600 0.0438
0.0141 8.1600 0.0322
0.0102 8.1800 0.0490
0.0101 8.6800 0.0322
0.0134 8.1000 0.0372
0.0134 8.3000 0.0338
0.0130 7.3600 0.0550
0.0137 7.1200 0.0323
0.0096 9.1200 0.0372
0.0179 7.4800 0.0283
0.0100 8.4900 0.0372];
f = scatteredInterpolant(k(:,1),k(:,2),k(:,3),'natural','linear');
[x,y] = meshgrid(linspace(min(k(:,1)),max(k(:,1)),50),linspace(min(k(:,2)),max(k(:,2)),50));
z = f(x,y);
figure
surf(x,y,z)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!