How to interpolate 2d data with constant spacing?
Show older comments
I try to figure out a way to linear interpolate my data. i am not quite sure how to tell him that for each step it should add the 10 new values at the end of the vector _lin. There is probably a faster way to do this but i am really lost and on the verge of a mentally breakdown since i cant figure out these kind of "simple" tasks. If anyone has an idea for an approach on how to manage this linear interpolation over the entire profil with constant spaceing i would be very grateful. i tried a little with the interp1 but i guess you also have to make a loop for over each data point.
if true
vz=[ 1.5000e+003 1.5397e+003 1.5577e+003 ;
0.0000e+000 2.0862e+001 1.0443e+002 ]
n=3
for i=1:n-1
v_lin=linspace(vz(1,i),vz(1,i+1),10); % It would be also great if one could interpolate the entire plot
v_lin=[v_lin v_lin(i)]; % Here i want the interpolated data to just add for each loop
z_lin=linspace(vz(2,i),vz(2,i+1),10);
z_lin=[z_lin z_lin(i)];
end
1 Comment
Sebastian
on 5 Dec 2017
Answers (0)
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!