Info

This question is closed. Reopen it to edit or answer.

Using Griddata Plotting with plot3

1 view (last 30 days)
Alexander Quinto
Alexander Quinto on 11 Dec 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
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);

Answers (0)

Community Treasure Hunt

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

Start Hunting!