Interpolation of a bed profile.
Show older comments
Hello,
I have a series of "radials" around a pier giving the depth of a bed and I wish to plot. However, before doing so would like to interpolate the 0 values in between the radials. Any suggestions how to accomplish would be much appreciated?
if true
23 0 0 34 0 0 26 0 0 29
0 22 0 21 0 0 24 0 31 0
0 0 20 22 0 0 22 23 0 0
0 0 0 -400 -400 -400 -400 0 0 0
24 26 25 -400 -400 -400 -400 24 25 29
0 0 0 -400 -400 -400 -400 0 0 0
0 0 25 28 0 0 31 26 0 0
0 26 0 29 0 0 24 0 27 0
27 0 0 30 0 0 27 0 0 29
end
This is small piece of one set of data there are much more zero values on the original and there are 16 different sets of data. So manually calculated is not viable.
Thanks in Advance.
Andy
Answers (1)
You can set the 0 values to NaN:
x(x==0) = NaN;
3 Comments
Andrew Buglass
on 5 Feb 2013
Jan
on 5 Feb 2013
A guidance is more likely, when you explain "cannot get it to work" with any details.
Sean de Wolski
on 5 Feb 2013
+1 for inpaint_nans
Categories
Find more on Surface and Mesh Plots 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!