Info

此问题已关闭。 请重新打开它进行编辑或回答。

Using Griddata Plotting with plot3

1 次查看(过去 30 天)
Alexander Quinto
Alexander Quinto 2017-12-11
关闭: MATLAB Answer Bot 2021-8-20
Hey, I am trying to tnterpolate 3-D scattered data using griddata, how would I accomplish it? The picture attached is the data plotted using the 'plot3' function. Thank you!
close all;
A1 = csvread('Circle6inch copy');
A2 = csvread('Circle12inchCopy');
A3 = csvread('Circle18inchCopy');
r = [6,12,18];
x = [cos(A1(:,1))*r(1); cos(A2(:,1))*r(2); cos(A3(:,1))*r(3)] ;
y = [sin(A1(:,1))*r(1); sin(A2(:,1))*r(2); sin(A3(:,1))*r(3)] ;
a = [A1(:,2); A2(:,2); A3(:,2)];
z = meshgrid(x,y);
n = length(x);
m = length(y);
for i = 1: n
for j = 1 : m
z(i,j)= a(j);
end
end
plot3(x,y,z);

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by