How can I smooth a surface in MATLAB? -


i have surface in matlab plotted using following code:

[xi, yi] = meshgrid(s/k, days); vq = griddata(s/k, days, rbf/k, xi, yi,'natural'); mesh(xi,yi,vq) 

the resulting image quite rough, , has lots of grid lines there 200 data points in each vector. possible plot mesh has smaller number of grid points (e.g. 20) averages out existing meshgrid, griddata surface?

one option use conv2 on vq data smooth, downsample @ander suggested:

n = 5; % averaging size vq_2 = conv2(vq, ones(n)/n.^2,'same'); mesh(xi(1:20:end,1:20,end),yi(1:20:end,1:20,end),vq_2(1:20:end,1:20,end)) 

there bit of edge effect default conv2 pads zeros.


Comments

Popular posts from this blog

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -