how to extrapolate data points/surface between two 3d lines
3 次查看(过去 30 天)
显示 更早的评论
I have three sets of data (the lines), the first set will have x and y data with z =3; the second set will have x and y data with z =6; and the third set will have x and y data with z =9. I am trying to connect these three line together to form a 3D surafce between these lines.
I tried to use the surf command, but it didn't work. Kindly take a look on the attached code.
I also attached a pic that may clarify what I need.
Any suggestions?
clc
close all
clear all
dataset =xlsread('fig 4, Number of beams.xlsx','N','G1:L203');
D1=dataset(:,2);
F1=dataset(:,1);
F2=dataset(:,3);
F3=dataset(:,5);
colormap hsv
figure(1)
plot (D1,F1,'.','MarkerSize',15);
hold on
plot (D1,F2,'-','MarkerSize',15);
plot (D1,F3,'--','MarkerSize',15);
hold off
z=[3*ones(201,1);6*ones(201,1);9*ones(201,1)];
XX = [D1;D1;D1];
YY = [F1;F2;F3];
Dlin = linspace(min(D1),max(D1));
Flin = linspace(min(F1),max(F3));
[X,Y] = meshgrid(Dlin,Flin);
figure(2)
scatter3(XX, YY, z)
grid on
Z= griddata(XX,YY,z,X,Y);
figure(3)
surf(X, Y, Z,'FaceColor','interp','EdgeColor','none','FaceLighting','gouraud');
Z= griddata(XX,YY,z,X,Y);
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!