Export ScatteredInterpolant to CSV at determined points

Hi All,
I've used scatteredInterpolant to portray a large number of survey points on a contour/surf. These points were taken in a grid form but not precise on each point (ie. first X row = 0.000, -0.018, 0.050, etc.). I would like to take points at every 1m point along the entirety of the x axis, then moving on to y+1 and taking xyz co-ordinates along the next row on the x axis to then be exported to a csv/text file.
I'm quite new to matlab so was wondering what the best way to do this would be?
Hopefully my question is not too confusing.
Thank you all very much for your help!

2 Comments

if you have your data in grid form then you must have 3 matrices: X, Y and Z. please correct me if I am wrong?
Yes I have X, Y, and Z. I have attached my original data and the code at the moment to display this as a surf. I now need to export it back to a csv in a defined grid (ie. a 300 x 300 grid at 1m spacing moving along all the points where y = 0, then y = 1, y = 2 etc.). So the first row would be 0,0,z then 1,0,z, 2,0,z etc. till the end of the row at y = 0 then would display 0,1,z, 1,1,z, 2,1,z etc.
if true
[Num,Txt,Raw]=xlsread('Survey_test.csv');
x=Num(:,1);
y=Num(:,2);
z=Num(:,3);
F = scatteredInterpolant(x,y,z)
[qx qy] = meshgrid(min(x):5:max(x),min(y):5:max(y))
qz = F(qx,qy);
surf(qx,qy,qz)
end
Hopefully this helps to explain my situation/goal a bit more, thank you in advance for the help!

Sign in to comment.

Answers (0)

Products

Release

R2018a

Asked:

on 4 Sep 2018

Commented:

on 17 Sep 2018

Community Treasure Hunt

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

Start Hunting!