Generate surface from boundary points
3 次查看(过去 30 天)
显示 更早的评论
I have thickness measurements of a rectangular test specimen. These measurements can only be taken at the boundary, but I would like to get a rough visualization of what the thickness looks like across the span of the panel using the boundary point measurements. This is a general idea of what data I have now using somewhat random numbers:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1647211/image.jpeg)
Is there any way I can make a surface out of this?
Thanks!
2 个评论
Dyuman Joshi
2024-3-20
The surface in between can be of any shape and size. You will have to specify more details or impose more restrictions to get a unique (or a set of unique) solution(s).
回答(1 个)
Voss
2024-3-20
x = linspace(0,3,6).';
y = linspace(0,1,6).';
nx = numel(x);
ny = numel(y);
zx = 0.134+0.007*rand(nx,2);
zy = [zx(1,1) zx(end,1); 0.134+0.007*rand(ny-2,2); zx(1,2) zx(end,2)];
figure
hold on
plot3(x,y(1)*ones(nx,1),zx(:,1))
plot3(x,y(end)*ones(nx,1),zx(:,2))
plot3(x(1)*ones(ny,1),y,zy(:,1))
plot3(x(end)*ones(ny,1),y,zy(:,2))
view(3)
[X,Y] = meshgrid(x,y);
XE = [X([1 end],:).'; X(2:end-1,[1 end])];
YE = [Y([1 end],:).'; Y(2:end-1,[1 end])];
ZE = [zx; zy(2:end-1,:)];
SI = scatteredInterpolant(XE(:),YE(:),ZE(:));
Z = SI(X,Y);
figure
surf(X,Y,Z,'FaceColor','interp','EdgeColor','none')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!